本文整理汇总了Java中org.apache.ojb.broker.query.Query类的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Query类属于org.apache.ojb.broker.query包,在下文中一共展示了Query类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPositionTypeList
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public List<PositionTypeBo> getPositionTypeList(String positionType, LocalDate asOfDate) {
List<PositionTypeBo> prgList = new ArrayList<PositionTypeBo>();
Criteria root = new Criteria();
if(StringUtils.isNotEmpty(positionType)
&& !ValidationUtils.isWildCard(positionType)) {
root.addEqualTo("positionType", positionType);
}
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(PositionTypeBo.class, asOfDate, PositionTypeBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(PositionTypeBo.class, PositionTypeBo.BUSINESS_KEYS, false));
Criteria activeFilter = new Criteria();
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(PositionTypeBo.class, root);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if(!c.isEmpty())
prgList.addAll(c);
return prgList;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:26,代码来源:PositionTypeDaoObjImpl.java
示例2: getActiveAssignments
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
public List<AssignmentBo> getActiveAssignments(LocalDate asOfDate) {
List<AssignmentBo> assignments = new ArrayList<AssignmentBo>();
Criteria root = new Criteria();
root.addLessOrEqualThan("effectiveDate", asOfDate.toDate());
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(AssignmentBo.class, asOfDate, AssignmentBo.BUSINESS_KEYS, true));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(AssignmentBo.class, AssignmentBo.BUSINESS_KEYS, true));
Criteria activeFilter = new Criteria();
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(AssignmentBo.class, root);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if (c != null) {
assignments.addAll(c);
}
return assignments;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:23,代码来源:AssignmentDaoOjbImpl.java
示例3: getMinBeginDatePendingLeaveCalendar
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public LeaveCalendarDocumentHeader getMinBeginDatePendingLeaveCalendar(String principalId) {
Criteria root = new Criteria();
Criteria crit = new Criteria();
List<String> pendingStatuses = new ArrayList<String>();
pendingStatuses.add(HrConstants.ROUTE_STATUS.ENROUTE);
pendingStatuses.add(HrConstants.ROUTE_STATUS.INITIATED);
pendingStatuses.add(HrConstants.ROUTE_STATUS.SAVED);
crit.addEqualTo("principalId", principalId);
crit.addIn("documentStatus", pendingStatuses);
ReportQueryByCriteria startDateSubQuery = QueryFactory.newReportQuery(LeaveCalendarDocumentHeader.class, crit);
startDateSubQuery.setAttributes(new String[]{"min(beginDate)"});
root.addEqualTo("principalId", principalId);
root.addIn("documentStatus", pendingStatuses);
root.addEqualTo("beginDate", startDateSubQuery);
Query query = QueryFactory.newQuery(LeaveCalendarDocumentHeader.class, root);
return (LeaveCalendarDocumentHeader) this.getPersistenceBrokerTemplate().getObjectByQuery(query);
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:22,代码来源:LeaveCalendarDocumentHeaderDaoOjbImpl.java
示例4: getActiveAccrualCategories
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
public List<AccrualCategoryBo> getActiveAccrualCategories(String leavePlan, LocalDate asOfDate){
List<AccrualCategoryBo> accrualCategories = new ArrayList<AccrualCategoryBo>();
Criteria root = new Criteria();
root.addEqualTo("leavePlan", leavePlan);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(AccrualCategoryBo.class, asOfDate, AccrualCategoryBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(AccrualCategoryBo.class, AccrualCategoryBo.BUSINESS_KEYS, false));
Criteria activeFilter = new Criteria(); // Inner Join For Activity
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(AccrualCategoryBo.class, root);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if (c != null) {
accrualCategories.addAll(c);
}
return accrualCategories;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:22,代码来源:AccrualCategoryDaoOjbImpl.java
示例5: getPayGrade
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public PayGradeBo getPayGrade(String payGrade, String salGroup, LocalDate asOfDate) {
Criteria root = new Criteria();
root.addEqualTo("payGrade", payGrade);
root.addEqualTo("salGroup", salGroup);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(PayGradeBo.class, asOfDate, PayGradeBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(PayGradeBo.class, PayGradeBo.BUSINESS_KEYS, false));
Criteria activeFilter = new Criteria(); // Inner Join For Activity
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(PayGradeBo.class, root);
PayGradeBo pg = (PayGradeBo)this.getPersistenceBrokerTemplate().getObjectByQuery(query);
return pg;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:21,代码来源:PayGradeDaoObjImpl.java
示例6: getLeavePlan
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public LeavePlanBo getLeavePlan(String leavePlan, LocalDate asOfDate) {
LeavePlanBo lp = null;
Criteria root = new Criteria();
root.addEqualTo("leavePlan", leavePlan);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(LeavePlanBo.class, asOfDate, LeavePlanBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(LeavePlanBo.class, LeavePlanBo.BUSINESS_KEYS, false));
Criteria activeFilter = new Criteria(); // Inner Join For Activity
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(LeavePlanBo.class, root);
Object obj = this.getPersistenceBrokerTemplate().getObjectByQuery(query);
if (obj != null) {
lp = (LeavePlanBo) obj;
}
return lp;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:24,代码来源:LeavePlanDaoOjbImpl.java
示例7: getAllAgingInvoiceDocumentsByProcessing
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
/**
* @see org.kuali.kfs.module.ar.document.dataaccess.CustomerInvoiceDocumentDao#getAllAgingInvoiceDocumentsByProcessing(java.util.List, java.util.List, java.sql.Date, java.sql.Date)
*/
@Override
public Collection<CustomerInvoiceDocument> getAllAgingInvoiceDocumentsByProcessing(List<String> charts, List<String> organizations, Date invoiceBillingDateFrom, Date invoiceBillingDateTo) {
Criteria criteria = this.getAllAgingInvoiceDocumentsCriteria(StringUtils.EMPTY, invoiceBillingDateFrom, invoiceBillingDateTo);
if(ObjectUtils.isNotNull(charts) && !charts.isEmpty()){
criteria.addIn(ArPropertyConstants.CustomerInvoiceDocumentFields.PROCESSING_CHART_OF_ACCOUNT_CODE, charts);
}
if(ObjectUtils.isNotNull(organizations) && !organizations.isEmpty()){
criteria.addIn(ArPropertyConstants.CustomerInvoiceDocumentFields.PROCESSING_ORGANIZATION_CODE, organizations);
}
criteria.addIsNull(ArPropertyConstants.AGING_REPORT_SENT_TIME);
Query query = QueryFactory.newQuery(CustomerInvoiceDocument.class, criteria);
return getPersistenceBrokerTemplate().getCollectionByQuery(query);
}
开发者ID:kuali,项目名称:kfs,代码行数:22,代码来源:CustomerInvoiceDocumentDaoOjb.java
示例8: getEdoDossierTypeList
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
/**
* Retrieve a list of all dossier types from the database
*
* @return a List of EdoDossierType objects
*/
public List<EdoDossierTypeBo> getEdoDossierTypeList() {
List<EdoDossierTypeBo> dossierTypeList = new LinkedList<EdoDossierTypeBo>();
Criteria cConditions = new Criteria();
Query query = QueryFactory.newQuery(EdoDossierTypeBo.class, cConditions);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if (c != null && c.size() != 0) {
if (c.size() > 0) {
dossierTypeList.addAll(c);
return dossierTypeList;
}
}
return null;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:23,代码来源:EdoDossierTypeDaoImpl.java
示例9: testNullCriteria
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
/**
* test Null Criteria
*/
public void testNullCriteria()
{
String name = "testNullCriteria_" + System.currentTimeMillis();
Person p = new Person();
p.setLastname(name);
broker.beginTransaction();
broker.store(p);
broker.commitTransaction();
Criteria crit = new Criteria();
crit.addIsNull("firstname");
Criteria crit2 = new Criteria();
crit2.addLike("lastname", name);
crit.addAndCriteria(crit2);
Query q = QueryFactory.newQuery(Person.class, crit);
Collection results = broker.getCollectionByQuery(q);
assertNotNull(results);
assertEquals(1, results.size());
}
开发者ID:KualiCo,项目名称:ojb,代码行数:25,代码来源:QueryTest.java
示例10: bindStatement
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
/**
* bind ExistsCriteria
* @param stmt the PreparedStatement
* @param index the position of the parameter to bind
* @param crit the Criteria containing the parameter
* @param cld the ClassDescriptor
* @return next index for PreparedStatement
*/
private int bindStatement(PreparedStatement stmt, int index, ExistsCriteria crit, ClassDescriptor cld) throws SQLException
{
Query subQuery = (Query) crit.getValue();
// if query has criteria, bind them
if (subQuery.getCriteria() != null && !subQuery.getCriteria().isEmpty())
{
return bindStatement(stmt, subQuery.getCriteria(), cld.getRepository().getDescriptorFor(subQuery.getSearchClass()), index);
// otherwise, just ignore it
}
else
{
return index;
}
}
开发者ID:KualiCo,项目名称:ojb,代码行数:25,代码来源:StatementManager.java
示例11: getJobs
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public List<JobBo> getJobs(String principalId, LocalDate payPeriodEndDate) {
List<JobBo> jobs = new LinkedList<JobBo>();
Criteria root = new Criteria();
root.addEqualTo("principalId", principalId);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(JobBo.class, payPeriodEndDate, JobBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(JobBo.class, JobBo.BUSINESS_KEYS, false));
Criteria activeFilter = new Criteria(); // Inner Join For Activity
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(JobBo.class, root);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if (c != null) {
jobs.addAll(c);
}
return jobs;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:25,代码来源:JobDaoOjbImpl.java
示例12: getHrGroupKeysWithLocations
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public List<HrGroupKeyBo> getHrGroupKeysWithLocations(List<String> locations, LocalDate asOfDate) {
List<HrGroupKeyBo> aList = new ArrayList<HrGroupKeyBo>();
Criteria root = new Criteria();
root.addIn("locationId", locations);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(HrGroupKeyBo.class, asOfDate, HrGroupKeyBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(HrGroupKeyBo.class, HrGroupKeyBo.BUSINESS_KEYS, false));
root.addEqualTo("active", true);
Query query = QueryFactory.newQuery(HrGroupKeyBo.class, root);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if(!c.isEmpty())
aList.addAll(c);
return aList;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:18,代码来源:HrGroupKeyDaoOjbImpl.java
示例13: testSubQuery1
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
/**
* test Subquery get all articles with price > avg(price) PROBLEM:
* avg(price) is NOT extent aware !!
* <p/>
* test may fail if db does not support sub queries
*/
public void testSubQuery1()
{
ReportQueryByCriteria subQuery;
Criteria subCrit = new Criteria();
Criteria crit = new Criteria();
subCrit.addLike("articleName", "A%");
subQuery = QueryFactory.newReportQuery(Article.class, subCrit);
subQuery.setAttributes(new String[]{"avg(price)"});
crit.addGreaterOrEqualThan("price", subQuery);
Query q = QueryFactory.newQuery(Article.class, crit);
Collection results = broker.getCollectionByQuery(q);
assertNotNull(results);
assertTrue(results.size() > 0);
}
开发者ID:KualiCo,项目名称:ojb,代码行数:26,代码来源:QueryTest.java
示例14: getAssignment
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
public AssignmentBo getAssignment(String principalId, String groupKeyCode, Long jobNumber, Long workArea, Long task, LocalDate asOfDate) {
Criteria root = new Criteria();
root.addEqualTo("principalId", principalId);
root.addEqualTo("groupKeyCode", groupKeyCode);
root.addEqualTo("jobNumber", jobNumber);
root.addEqualTo("workArea", workArea);
root.addEqualTo("task", task);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(AssignmentBo.class, asOfDate, AssignmentBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(AssignmentBo.class, AssignmentBo.BUSINESS_KEYS, false));
//root.addEqualTo("active", true);
Criteria activeFilter = new Criteria(); // Inner Join For Activity
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(AssignmentBo.class, root);
Object o = this.getPersistenceBrokerTemplate().getObjectByQuery(query);
return (AssignmentBo) o;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:22,代码来源:AssignmentDaoOjbImpl.java
示例15: getPendingItemsByDossierId
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public List<EdoItemBo> getPendingItemsByDossierId(String edoDossierId, String edoChecklistItemId) {
List<EdoItemBo> itemList = new LinkedList<EdoItemBo>();
Criteria cConditions = new Criteria();
cConditions.addEqualTo("edoDossierId", edoDossierId);
cConditions.addEqualTo("edoChecklistItemId", edoChecklistItemId);
cConditions.addEqualTo("routed", true);
Query query = QueryFactory.newQuery(EdoItemBo.class, cConditions);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if (c != null && c.size() != 0) {
itemList.addAll(c);
return itemList;
}
return null;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:20,代码来源:EdoItemDaoImpl.java
示例16: getActiveLeaveJobs
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<JobBo> getActiveLeaveJobs(String principalId, LocalDate asOfDate) {
Criteria root = new Criteria();
root.addEqualTo("principalId", principalId);
root.addEqualTo("eligibleForLeave", true);
root.addEqualTo("active", true);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(JobBo.class, asOfDate, JobBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(JobBo.class, JobBo.BUSINESS_KEYS, false));
Query query = QueryFactory.newQuery(JobBo.class, root);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
// remove jobs that has been inactive from the list
List<JobBo> jobList = new ArrayList<JobBo>();
jobList.addAll(c);
List<JobBo> aList = new ArrayList<JobBo>();
aList.addAll(jobList);
for(JobBo aJob : aList) {
List<JobBo> inactiveJobs = this.getInactiveLeaveJobs(aJob.getJobNumber(), aJob.getPrincipalId(), aJob.getEffectiveLocalDate());
if(!inactiveJobs.isEmpty()) {
jobList.remove(aJob);
}
}
return jobList;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:26,代码来源:JobDaoOjbImpl.java
示例17: getEarnCodeGroupSummaryForEarnCode
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public EarnCodeGroupBo getEarnCodeGroupSummaryForEarnCode(String earnCode, LocalDate asOfDate) {
Criteria root = new Criteria();
Criteria earnCodeJoin = new Criteria();
earnCodeJoin.addEqualToField("hrEarnCodeGroupId", Criteria.PARENT_QUERY_PREFIX + "hrEarnCodeGroupId");
earnCodeJoin.addEqualTo("UPPER(earnCode)", earnCode.toUpperCase());
ReportQueryByCriteria earnCodeSubQuery = QueryFactory.newReportQuery(EarnCodeGroupDefinitionBo.class, earnCodeJoin);
earnCodeSubQuery.setAttributes(new String[]{"hr_earn_code_group_id"});
root.addEqualTo("hrEarnCodeGroupId",earnCodeSubQuery);
root.addEqualTo("effectiveDate", OjbSubQueryUtil.getEffectiveDateSubQuery(EarnCodeGroupBo.class, asOfDate, EarnCodeGroupBo.BUSINESS_KEYS, false));
root.addEqualTo("timestamp", OjbSubQueryUtil.getTimestampSubQuery(EarnCodeGroupBo.class, EarnCodeGroupBo.BUSINESS_KEYS, false));
// root.addEqualTo("active", true);
root.addEqualTo("showSummary", true);
Criteria activeFilter = new Criteria(); // Inner Join For Activity
activeFilter.addEqualTo("active", true);
root.addAndCriteria(activeFilter);
Query query = QueryFactory.newQuery(EarnCodeGroupBo.class, root);
EarnCodeGroupBo earnGroupObj = (EarnCodeGroupBo)this.getPersistenceBrokerTemplate().getObjectByQuery(query);
return earnGroupObj;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:25,代码来源:EarnCodeGroupDaoOjbImpl.java
示例18: getReviewerNoteById
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
/**
* Retrieve a single item type from the database given the specified ID
*
* @param edoReviewerNoteId the database ID of the requested item type
* @return an object of EdoReviewerNoteBo, null on error or no data
*/
public EdoReviewerNoteBo getReviewerNoteById(String edoReviewerNoteId) {
Criteria cConditions = new Criteria();
cConditions.addEqualTo("edoReviewerNoteId", edoReviewerNoteId);
Query query = QueryFactory.newQuery(EdoReviewerNoteBo.class, cConditions);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if (c != null && c.size() != 0) {
if (c.size() == 1) {
return (EdoReviewerNoteBo)c.toArray()[0];
}
}
return null;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:24,代码来源:EdoReviewerNoteDaoImpl.java
示例19: getUpdateStmt
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
public PreparedStatement getUpdateStmt(Connection con) throws SQLException
{
if (updateSql == null)
{
updateSql = sqlGenerator.getPreparedUpdateStatement(classDescriptor).getStatement();
}
try
{
return prepareStatement(con,
updateSql,
Query.NOT_SCROLLABLE,
usePreparedUpdateStatement(),
StatementManagerIF.FETCH_SIZE_NOT_APPLICABLE);
}
catch (SQLException ex)
{
log.error("Can't prepare update statement: " + updateSql, ex);
throw ex;
}
}
开发者ID:KualiCo,项目名称:ojb,代码行数:21,代码来源:StatementsForClassImpl.java
示例20: getBalanceTransfers
import org.apache.ojb.broker.query.Query; //导入依赖的package包/类
@Override
public List<BalanceTransfer> getBalanceTransfers(String viewPrincipal, LocalDate beginPeriodDate, LocalDate endPeriodDate) {
// TODO Auto-generated method stub
List<BalanceTransfer> balanceTransfers = new ArrayList<BalanceTransfer>();
Criteria crit = new Criteria();
crit.addEqualTo("principalId",viewPrincipal);
Criteria effDate = new Criteria();
effDate.addGreaterOrEqualThan("effectiveDate", beginPeriodDate.toDate());
effDate.addLessOrEqualThan("effectiveDate", endPeriodDate.toDate());
crit.addAndCriteria(effDate);
Query query = QueryFactory.newQuery(BalanceTransfer.class,crit);
Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);
if(c != null)
balanceTransfers.addAll(c);
return balanceTransfers;
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:23,代码来源:BalanceTransferDaoOjbImpl.java
注:本文中的org.apache.ojb.broker.query.Query类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论