• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Criteria类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.ojb.broker.query.Criteria的典型用法代码示例。如果您正苦于以下问题:Java Criteria类的具体用法?Java Criteria怎么用?Java Criteria使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Criteria类属于org.apache.ojb.broker.query包,在下文中一共展示了Criteria类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addPredicate

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/** adds a predicate to a Criteria.*/
private void addPredicate(Predicate p, Criteria parent, LookupCustomizer.Transform<Predicate, Predicate> transform) {
    p = transform.apply(p);

    if (p instanceof PropertyPathPredicate) {
        final String pp = ((PropertyPathPredicate) p).getPropertyPath();
        if (p instanceof NotNullPredicate) {
            parent.addNotNull(pp);
        } else if (p instanceof NullPredicate) {
            parent.addIsNull(pp);
        } else if (p instanceof SingleValuedPredicate) {
            addSingleValuePredicate((SingleValuedPredicate) p, parent);
        } else if (p instanceof MultiValuedPredicate) {
            addMultiValuePredicate((MultiValuedPredicate) p, parent);
        } else {
            throw new UnsupportedPredicateException(p);
        }
    } else if (p instanceof CompositePredicate) {
        addCompositePredicate((CompositePredicate) p, parent, transform);
    } else {
        throw new UnsupportedPredicateException(p);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:CriteriaLookupDaoOjb.java


示例2: getCollectionCriteriaFromMapUsingPrimaryKeysOnly

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
public Criteria getCollectionCriteriaFromMapUsingPrimaryKeysOnly(Class businessObjectClass, Map formProps) {
    BusinessObject businessObject = checkBusinessObjectClass(businessObjectClass);
    Criteria criteria = new Criteria();
    List pkFields = KRADServiceLocatorWeb.getLegacyDataAdapter().listPrimaryKeyFieldNames(businessObjectClass);
    Iterator pkIter = pkFields.iterator();
    while (pkIter.hasNext()) {
        String pkFieldName = (String) pkIter.next();
        String pkValue = (String) formProps.get(pkFieldName);

        if (StringUtils.isBlank(pkValue)) {
            throw new RuntimeException("Missing pk value for field " + pkFieldName + " when a search based on PK values only is performed.");
        }
        else {
            for (SearchOperator op : SearchOperator.QUERY_CHARACTERS) {
                if (pkValue.contains(op.op())) {
                    throw new RuntimeException("Value \"" + pkValue + "\" for PK field " + pkFieldName + " contains wildcard/operator characters.");
                }
            }
        }
        boolean treatWildcardsAndOperatorsAsLiteral = KNSServiceLocator.
        		getBusinessObjectDictionaryService().isLookupFieldTreatWildcardsAndOperatorsAsLiteral(businessObjectClass, pkFieldName);
        createCriteria(businessObject, pkValue, pkFieldName, false, treatWildcardsAndOperatorsAsLiteral, criteria);
    }
    return criteria;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:LookupDaoOjb.java


示例3: applySearchResultsLimit

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * This method applies the search results limit to the search criteria for this BO
 *
 * @param businessObjectClass BO class to search on / get limit for
 * @param criteria search criteria
 * @param platform database platform
 * @param limit limit to use.  If limit is null, getSearchResultsLimit will be called using the businessObjectClass
 * to see if a limit can be found for this particular businessObjectClass.
 */
protected void applySearchResultsLimit(Class businessObjectClass, Criteria criteria, DatabasePlatform platform,
        Integer limit) {
    String limitSql = null;
    if (limit != null) {
        limitSql = platform.applyLimitSql(limit);
    } else {
        limit = LookupUtils.getSearchResultsLimit(businessObjectClass, null);
        if (limit != null) {
            limitSql = platform.applyLimitSql(limit);
        }
    }
    if (StringUtils.isNotBlank(limitSql)) {
        criteria.addSql(limitSql);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:LookupDaoOjb.java


示例4: addNotCriteria

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
private void addNotCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, Criteria criteria) {

        String[] splitPropVal = StringUtils.split(propertyValue, SearchOperator.NOT.op());
        try {
            int strLength = splitPropVal.length;
            // if Not'ed empty criteria
            if (strLength == 0)
                throw new IllegalArgumentException("Improper syntax of NOT operator in " + propertyName);
            // if more than one NOT operator assume an implicit and (i.e. !a!b = !a&!b)
            if (strLength > 1) {
                String expandedNot = SearchOperator.NOT + StringUtils.join(splitPropVal, SearchOperator.AND.op() + SearchOperator.NOT.op());
                // we know that since this method was called, treatWildcardsAndOperatorsAsLiteral must be false
                addCriteria(propertyName, expandedNot, propertyType, caseInsensitive, false, criteria);
            }
            else {
                // only one so add a not like
                criteria.addNotLike(propertyName, splitPropVal[0]);
            }
        } catch (IllegalArgumentException ex) {
            GlobalVariables.getMessageMap().putError("lookupCriteria[" + propertyName + "]", RiceKeyConstants.ERROR_NOT_SYNTAX, propertyName);
        }
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:LookupDaoOjb.java


示例5: addLogicalOperatorCriteria

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * Builds a sub criteria object joined with an 'AND' or 'OR' (depending on splitValue) using the split values of propertyValue. Then joins back the
 * sub criteria to the main criteria using an 'AND'.
 */
private void addLogicalOperatorCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, Criteria criteria, String splitValue) {
    String[] splitPropVal = StringUtils.split(propertyValue, splitValue);

    Criteria subCriteria = new Criteria();
    for (int i = 0; i < splitPropVal.length; i++) {
    	Criteria predicate = new Criteria();

        addCriteria(propertyName, splitPropVal[i], propertyType, caseInsensitive, false, predicate);
        if (splitValue.equals(SearchOperator.OR.op())) {
        	subCriteria.addOrCriteria(predicate);
        }
        if (splitValue.equals(SearchOperator.AND.op())) {
        	subCriteria.addAndCriteria(predicate);
        }
    }

    criteria.addAndCriteria(subCriteria);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:LookupDaoOjb.java


示例6: addStringRangeCriteria

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * Adds to the criteria object based on query characters given
 */
private void addStringRangeCriteria(String propertyName, String propertyValue, Criteria criteria) {

    try {
        if (StringUtils.contains(propertyValue, SearchOperator.BETWEEN.op())) {
            String[] rangeValues = StringUtils.split(propertyValue, SearchOperator.BETWEEN.op());
            if (rangeValues.length < 2)
                throw new IllegalArgumentException("Improper syntax of BETWEEN operator in " + propertyName);

            criteria.addBetween(propertyName, rangeValues[0], rangeValues[1]);
        } else if (propertyValue.startsWith(SearchOperator.GREATER_THAN_EQUAL.op())) {
            criteria.addGreaterOrEqualThan(propertyName, ObjectUtils.clean(propertyValue));
        } else if (propertyValue.startsWith(SearchOperator.LESS_THAN_EQUAL.op())) {
            criteria.addLessOrEqualThan(propertyName, ObjectUtils.clean(propertyValue));
        } else if (propertyValue.startsWith(SearchOperator.GREATER_THAN.op())) {
            criteria.addGreaterThan(propertyName, ObjectUtils.clean(propertyValue));
        } else if (propertyValue.startsWith(SearchOperator.LESS_THAN.op())) {
            criteria.addLessThan(propertyName, ObjectUtils.clean(propertyValue));
        } else {
            criteria.addEqualTo(propertyName, ObjectUtils.clean(propertyValue));
        }
    } catch (IllegalArgumentException ex) {
        GlobalVariables.getMessageMap().putError("lookupCriteria[" + propertyName + "]", RiceKeyConstants.ERROR_BETWEEN_SYNTAX, propertyName);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:LookupDaoOjb.java


示例7: findByDocumentHeaderIds

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * Retrieve a List of Document instances with the given ids
 *
 * @param clazz
 * @param idList
 * @return List
 */
@Override
public <T extends Document> List<T> findByDocumentHeaderIds(Class<T> clazz, List<String> idList) {
    Criteria criteria = new Criteria();
    criteria.addIn(KRADPropertyConstants.DOCUMENT_NUMBER, idList);

    QueryByCriteria query = QueryFactory.newQuery(clazz, criteria);
    
    // this cast is correct because OJB produces a collection which contains elements of the class defined on the query
    @SuppressWarnings("unchecked")
    List<T> tempList = new ArrayList<T>(this.getPersistenceBrokerTemplate().getCollectionByQuery(query));
    
    for (T doc : tempList) {
    	documentAdHocService.addAdHocs(doc);
    }
    return tempList;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:DocumentDaoOjb.java


示例8: findBySinglePrimaryKey

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.dao.BusinessObjectDao#findBySinglePrimaryKey(java.lang.Class, java.lang.Object)
 */
public <T extends BusinessObject> T findBySinglePrimaryKey(Class<T> clazz, Object primaryKey) {
	if (primaryKey.getClass().getName().startsWith("java.lang.")
               || primaryKey.getClass().getName().startsWith("java.sql.")
               || primaryKey.getClass().getName().startsWith("java.math.")
               || primaryKey.getClass().getName().startsWith("java.util.")) {
		try {
			return (T) getPersistenceBrokerTemplate().getObjectById(clazz, primaryKey);
		} catch (  ObjectRetrievalFailureException ex  ) {
    		// it doesn't exist, just return null
			return null;
		}
	} else {
		Criteria criteria = buildCriteria(clazz, primaryKey);

        return (T) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(clazz, criteria));
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:BusinessObjectDaoOjb.java


示例9: buildCriteria

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * This method will build out criteria in the key-value paradigm (attribute-value).
 *
 * @param fieldValues
 * @return
 */
private Criteria buildCriteria(Map<String, ?> fieldValues) {
    Criteria criteria = new Criteria();
    for (Iterator i = fieldValues.entrySet().iterator(); i.hasNext();) {
        Map.Entry<String, Object> e = (Map.Entry<String, Object>) i.next();

        String key = e.getKey();
        Object value = e.getValue();
        if (value instanceof Collection) {
            criteria.addIn(key, (Collection) value);
        } else {
            criteria.addEqualTo(key, value);
        }
    }

    return criteria;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:BusinessObjectDaoOjb.java


示例10: buildNegativeCriteria

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * This method will build out criteria in the key-value paradigm (attribute-value).
 *
 * @param negativeFieldValues
 * @return
 */
private Criteria buildNegativeCriteria(Map<String, ?> negativeFieldValues) {
    Criteria criteria = new Criteria();
    for (Iterator i = negativeFieldValues.entrySet().iterator(); i.hasNext();) {
        Map.Entry<String, Object> e = (Map.Entry<String, Object>) i.next();

        String key = e.getKey();
        Object value = e.getValue();
        if (value instanceof Collection) {
            criteria.addNotIn(key, (Collection) value);
        }
        else {
            criteria.addNotEqualTo(key, value);
        }
    }

    return criteria;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:BusinessObjectDaoOjb.java


示例11: getLockingDocumentNumber

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.dao.MaintenanceDocumentDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
 */
public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {

    String lockingDocNumber = "";

    // build the query criteria
    Criteria criteria = new Criteria();
    criteria.addEqualTo("lockingRepresentation", lockingRepresentation);

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        criteria.addNotEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
    }

    // attempt to retrieve a document based off this criteria
    MaintenanceLock maintenanceLock = (MaintenanceLock) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(MaintenanceLock.class, criteria));

    // if a document was found, then there's already one out there pending, and
    // we consider it 'locked' and we return the docnumber.
    if (maintenanceLock != null) {
        lockingDocNumber = maintenanceLock.getDocumentNumber();
    }
    return lockingDocNumber;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:MaintenanceDocumentDaoOjb.java


示例12: addNumericCriteria

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
public static void addNumericCriteria(Criteria criteria, String propertyName, String propertyValue) {
    if (StringUtils.contains(propertyValue, SearchOperator.BETWEEN.op())) {
        String[] rangeValues = StringUtils.split(propertyValue, SearchOperator.BETWEEN.op());
        criteria.addBetween(propertyName, TKUtils.cleanNumeric(rangeValues[0]), TKUtils.cleanNumeric( rangeValues[1] ));
    } else if (propertyValue.startsWith(SearchOperator.GREATER_THAN_EQUAL.op())) {
        criteria.addGreaterOrEqualThan(propertyName, TKUtils.cleanNumeric(propertyValue));
    } else if (propertyValue.startsWith(SearchOperator.LESS_THAN_EQUAL.op())) {
        criteria.addLessOrEqualThan(propertyName, TKUtils.cleanNumeric(propertyValue));
    } else if (propertyValue.startsWith(SearchOperator.GREATER_THAN.op())) {
        criteria.addGreaterThan(propertyName, TKUtils.cleanNumeric( propertyValue ) );
    } else if (propertyValue.startsWith(SearchOperator.LESS_THAN.op())) {
        criteria.addLessThan(propertyName, TKUtils.cleanNumeric(propertyValue));
    } else {
        criteria.addEqualTo(propertyName, TKUtils.cleanNumeric(propertyValue));
    }
}
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:17,代码来源:OjbSubQueryUtil.java


示例13: getByTransaction

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * Fetches the reversal record that would affected by the posting of the given transaction
 * 
 * @param t the transaction to find the related reversal for
 * @return the reversal affected by the given transaction
 * @see org.kuali.kfs.gl.dataaccess.ReversalDao#getByTransaction(org.kuali.kfs.gl.businessobject.Transaction)
 */
public Reversal getByTransaction(Transaction t) {
    LOG.debug("getByTransaction() started");

    Criteria crit = new Criteria();
    crit.addEqualTo(KFSPropertyConstants.FINANCIAL_DOCUMENT_REVERSAL_DATE, t.getFinancialDocumentReversalDate());
    crit.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, t.getUniversityFiscalYear());
    crit.addEqualTo(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, t.getChartOfAccountsCode());
    crit.addEqualTo(KFSPropertyConstants.ACCOUNT_NUMBER, t.getAccountNumber());
    crit.addEqualTo(KFSPropertyConstants.SUB_ACCOUNT_NUMBER, t.getSubAccountNumber());
    crit.addEqualTo(KFSPropertyConstants.FINANCIAL_OBJECT_CODE, t.getFinancialObjectCode());
    crit.addEqualTo(KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE, t.getFinancialSubObjectCode());
    crit.addEqualTo(KFSPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE, t.getFinancialBalanceTypeCode());
    crit.addEqualTo(KFSPropertyConstants.FINANCIAL_OBJECT_TYPE_CODE, t.getFinancialObjectTypeCode());
    crit.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_PERIOD_CODE, t.getUniversityFiscalPeriodCode());
    crit.addEqualTo(KFSPropertyConstants.FINANCIAL_DOCUMENT_TYPE_CODE, t.getFinancialDocumentTypeCode());
    crit.addEqualTo(KFSPropertyConstants.FINANCIAL_SYSTEM_ORIGINATION_CODE, t.getFinancialSystemOriginationCode());
    crit.addEqualTo(KFSPropertyConstants.DOCUMENT_NUMBER, t.getDocumentNumber());
    crit.addEqualTo(KFSPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER, t.getTransactionLedgerEntrySequenceNumber());

    QueryByCriteria qbc = QueryFactory.newQuery(Reversal.class, crit);
    return (Reversal) getPersistenceBrokerTemplate().getObjectByQuery(qbc);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:30,代码来源:ReversalDaoOjb.java


示例14: readAcctReportsTo

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
protected void readAcctReportsTo() {
    // we will use a report query, to bypass the "persistence" bureaucracy and its cache, saving memory and time
    // we will use the OJB class as a convenient container object in the hashmap
    Integer sqlChartOfAccountsCode = 0;
    Integer sqlAccountNumber = 1;
    Integer sqlReportsToChartofAccountsCode = 2;
    Integer sqlOrganizationCode = 3;
    Criteria criteriaID = ReportQueryByCriteria.CRITERIA_SELECT_ALL;
    // we always get a new copy of the map
    acctRptsToMap = new HashMap<String, BudgetConstructionAccountReports>(hashObjectSize(BudgetConstructionAccountReports.class, criteriaID));
    String[] queryAttr = { KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, KFSPropertyConstants.ACCOUNT_NUMBER, KFSPropertyConstants.REPORTS_TO_CHART_OF_ACCOUNTS_CODE, KFSPropertyConstants.REPORTS_TO_ORGANIZATION_CODE };
    ReportQueryByCriteria queryID = new ReportQueryByCriteria(BudgetConstructionAccountReports.class, queryAttr, criteriaID);
    Iterator Results = getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(queryID);
    while (Results.hasNext()) {
        Object[] ReturnList = (Object[]) Results.next();
        BudgetConstructionAccountReports acctRpts = new BudgetConstructionAccountReports();
        acctRpts.setChartOfAccountsCode((String) ReturnList[sqlChartOfAccountsCode]);
        acctRpts.setAccountNumber((String) ReturnList[sqlAccountNumber]);
        acctRpts.setReportsToChartOfAccountsCode((String) ReturnList[sqlReportsToChartofAccountsCode]);
        acctRpts.setReportsToOrganizationCode((String) ReturnList[sqlOrganizationCode]);
        String TestKey = getAcctRptsToKey(acctRpts);
        acctRptsToMap.put(TestKey, acctRpts);
    }
    LOG.info("\nAccount Reports To for Organization Hierarchy:");
    LOG.info(String.format("\nNumber of account-reports-to rows: %d", acctRptsToMap.size()));
}
 
开发者ID:kuali,项目名称:kfs,代码行数:27,代码来源:GenesisDaoOjb.java


示例15: getSuppLevelQualifierByWorkflowId

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
public String getSuppLevelQualifierByWorkflowId(String workflowId, String nodeName) {
    String qualifier = null;

    Criteria criteria = new Criteria();
    criteria.addEqualTo(EdoPropertyConstants.EdoSuppReviewLayerDefinitionFields.WORKFLOW_ID, workflowId);
    criteria.addEqualTo(EdoPropertyConstants.EdoSuppReviewLayerDefinitionFields.NODE_NAME, nodeName);

    ReportQueryByCriteria query = QueryFactory.newReportQuery(EdoSuppReviewLayerDefinitionBo.class, criteria);

    Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);

    for (Object obj : c ) {
        EdoSuppReviewLayerDefinitionBo suppReviewLayer = (EdoSuppReviewLayerDefinitionBo)obj;
        // We don't have qualifier in EdoSuppReviewLayerDefinition any more
        //qualifier = suppReviewLayer.getWorkflowQualifier();
    }

    return qualifier;
}
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:20,代码来源:EdoSuppReviewLayerDefinitionDaoImpl.java


示例16: getLeaveBlocksWithAccrualCategory

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
@Override
    public List<LeaveBlockBo> getLeaveBlocksWithAccrualCategory(String principalId, LocalDate beginDate, LocalDate endDate, String accrualCategory) {
        List<LeaveBlockBo> leaveBlocks = new ArrayList<LeaveBlockBo>();
        Criteria root = new Criteria();
        root.addEqualTo("principalId", principalId);
        root.addGreaterOrEqualThan("leaveDate", beginDate.toDate());
        root.addLessOrEqualThan("leaveDate", endDate.toDate());
        root.addEqualTo("accrualCategory", accrualCategory);
//        root.addEqualTo("active", true);

        Query query = QueryFactory.newQuery(LeaveBlockBo.class, root);
        Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query);

        if (c != null) {
            leaveBlocks.addAll(c);
        }

        return leaveBlocks;
    }
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:20,代码来源:LeaveBlockDaoOjbImpl.java


示例17: getDocumentNumbersOfCorrectionReceivingByCriteria

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
protected List<String> getDocumentNumbersOfCorrectionReceivingByCriteria(Criteria criteria, boolean orderByAscending) {
    ReportQueryByCriteria rqbc = new ReportQueryByCriteria(CorrectionReceivingDocument.class, criteria);
    if (orderByAscending) {
        rqbc.addOrderByAscending(OLEPropertyConstants.DOCUMENT_NUMBER);
    } else {
        rqbc.addOrderByDescending(OLEPropertyConstants.DOCUMENT_NUMBER);
    }

    List<CorrectionReceivingDocument> correctionRecvDocs = (List<CorrectionReceivingDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(rqbc);

    List<String> returnList = new ArrayList<String>();

    for (CorrectionReceivingDocument correctionRecvDoc : correctionRecvDocs) {
        returnList.add(correctionRecvDoc.getDocumentNumber());
    }

    return returnList;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:19,代码来源:ReceivingDaoOjb.java


示例18: hasPendingLaborLedgerEntry

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * @see org.kuali.kfs.module.ld.dataaccess.LaborLedgerPendingEntryDao#hasPendingLaborLedgerEntry(java.util.Map,
 *      java.lang.Object)
 */
public Collection<LaborLedgerPendingEntry> hasPendingLaborLedgerEntry(Map fieldValues, Object businessObject) {
    LOG.debug("hasPendingLaborLedgerEntry() started");

    Criteria criteria = new Criteria();
    for (Iterator iter = fieldValues.keySet().iterator(); iter.hasNext();) {
        String element = (String) iter.next();
        if (element.equals("documentNumber")) {
            criteria.addNotEqualTo(element, fieldValues.get(element));
        }
        else {
            criteria.addEqualTo(element, fieldValues.get(element));
        }
    }

    QueryByCriteria qbc = QueryFactory.newQuery(getEntryClass(), criteria);

    return getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:23,代码来源:LaborLedgerPendingEntryDaoOjb.java


示例19: getGeneralLedgerReportQuery

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * Generate Query object for GeneralLedgerEntry search.
 *
 * @param fieldValues
 * @return
 */
protected ReportQueryByCriteria getGeneralLedgerReportQuery(Map fieldValues) {
    Collection docTypeCodes = getDocumentType(fieldValues);
    Collection activityStatusCodes = getActivityStatusCode(fieldValues);

    Criteria criteria = OJBUtility.buildCriteriaFromMap(fieldValues, new GeneralLedgerEntry());

    // set document type code criteria
    if (!docTypeCodes.isEmpty()) {
        criteria.addIn(CabPropertyConstants.GeneralLedgerEntry.FINANCIAL_DOCUMENT_TYPE_CODE, docTypeCodes);
    }
    // set activity status code criteria
    if (!activityStatusCodes.isEmpty()) {
        criteria.addIn(CabPropertyConstants.GeneralLedgerEntry.ACTIVITY_STATUS_CODE, activityStatusCodes);
    }
    ReportQueryByCriteria query = QueryFactory.newReportQuery(GeneralLedgerEntry.class, criteria);

    List attributeList = buildAttributeList(false);

    // set the selection attributes
    String[] attributes = (String[]) attributeList.toArray(new String[attributeList.size()]);
    query.setAttributes(attributes);
    return query;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:30,代码来源:PurchasingAccountsPayableReportDaoOjb.java


示例20: getLockingDocumentNumber

import org.apache.ojb.broker.query.Criteria; //导入依赖的package包/类
/**
 * @see org.kuali.ole.coa.dataaccess.AccountDelegateDao#getLockingDocumentNumber(java.lang.String, java.lang.String)
 */

public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber) {
    String lockingDocNumber = "";

    // build the query criteria
    Criteria criteria = new Criteria();
    criteria.addEqualTo("lockingRepresentation", lockingRepresentation);

    // if a docHeaderId is specified, then it will be excluded from the
    // locking representation test.
    if (StringUtils.isNotBlank(documentNumber)) {
        criteria.addNotEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber);
    }

    // attempt to retrieve a document based off this criteria
    MaintenanceLock maintenanceLock = (MaintenanceLock) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(MaintenanceLock.class, criteria));

    // if a document was found, then there's already one out there pending, and
    // we consider it 'locked' and we return the docnumber.
    if (maintenanceLock != null) {
        lockingDocNumber = maintenanceLock.getDocumentNumber();
    }
    return lockingDocNumber;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:28,代码来源:AccountDelegateDaoOjb.java



注:本文中的org.apache.ojb.broker.query.Criteria类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CtField类代码示例发布时间:2022-05-23
下一篇:
Java Shadow类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap