/** * @@see {@link org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getAllTransactionArchives() */ public Collection<TransactionArchive> getAllTransactionArchives() { Collection<TransactionArchive> transactionArchives = new ArrayList(); Criteria criteria = new Criteria(); criteria.addNotNull(EndowPropertyConstants.DOCUMENT_NUMBER); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); transactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query); return transactionArchives; }
/** * Builds a criteria to find expired accounts * @return a Criteria for expired accounts */ protected Criteria getAccountExpiredCriteria() { Criteria criteria = new Criteria(); criteria.addNotNull("accountExpirationDate"); criteria.addLessOrEqualThan("accountExpirationDate", dateTimeService.getCurrentSqlDate()); return criteria; }
/** * @@see {@link org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getAllTransactionArchives() */ public Collection<TransactionArchive> getAllTransactionArchives() { Collection<TransactionArchive> transactionArchives = new ArrayList(); Criteria criteria = new Criteria(); criteria.addNotNull(EndowPropertyConstants.DOCUMENT_NUMBER); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); transactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query); return transactionArchives; }
public Query customizeQuery(Object owner, PersistenceBroker broker, CollectionDescriptor collDescriptor, QueryByCriteria query) { String isClone = this.getAttribute(CLONE_FIELD, "false"); if (isClone.equals("false")) { query.getCriteria().addIsNull("cloneParent"); } else { query.getCriteria().addNotNull("cloneParent"); } return query; } }
/** * @see org.kuali.kfs.module.purap.document.dataaccess.PurchaseOrderDao#getAutoCloseRecurringPurchaseOrders(java.util.List) */ public List<AutoClosePurchaseOrderView> getAutoCloseRecurringPurchaseOrders(List<String> excludedVendorChoiceCodes) { LOG.debug("getAutoCloseRecurringPurchaseOrders() started."); Criteria criteria = new Criteria(); criteria.addNotNull(PurapPropertyConstants.RECURRING_PAYMENT_TYPE_CODE); criteria.addEqualTo(PurapPropertyConstants.PURCHASE_ORDER_STATUS_CODE, PurapConstants.PurchaseOrderStatuses.OPEN); for (String excludeCode : excludedVendorChoiceCodes) { criteria.addNotEqualTo(PurapPropertyConstants.VENDOR_CHOICE_CODE, excludeCode); } QueryByCriteria qbc = new QueryByCriteria(AutoClosePurchaseOrderView.class, criteria); LOG.debug("getAutoCloseRecurringPurchaseOrders() Query criteria is " + criteria.toString()); List<AutoClosePurchaseOrderView> l = (List<AutoClosePurchaseOrderView>) getPersistenceBrokerTemplate().getCollectionByQuery(qbc); LOG.debug("getAutoCloseRecurringPurchaseOrders() ended."); return l; }
@Override public List<BalanceTransfer> getAllBalanceTransfersMarkedPayoutForPrincipalId( String principalId) { Criteria crit = new Criteria(); List<BalanceTransfer> balanceTransfers = new ArrayList<BalanceTransfer>(); crit.addEqualTo("principalId",principalId); Criteria payoutCrit = new Criteria(); payoutCrit.addNotNull("earnCode"); crit.addAndCriteria(payoutCrit); Query query = QueryFactory.newQuery(BalanceTransfer.class,crit); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if(c != null) balanceTransfers.addAll(c); return balanceTransfers; }
@SuppressWarnings("unchecked") public Collection<PortletDefinition> getAllCloneDefinitions() { Criteria c = new Criteria(); c.addNotNull("cloneParent"); Collection<PortletDefinition> list = getPersistenceBrokerTemplate().getCollectionByQuery( QueryFactory.newQuery(PortletDefinitionImpl.class, c)); postLoadColl(list); return list; }
@Override public List<LeavePayout> getAllLeavePayoutsMarkedPayoutForPrincipalId( String principalId) { Criteria crit = new Criteria(); List<LeavePayout> leavePayouts = new ArrayList<LeavePayout>(); crit.addEqualTo("principalId",principalId); Criteria payoutCrit = new Criteria(); payoutCrit.addNotNull("earnCode"); crit.addAndCriteria(payoutCrit); Query query = QueryFactory.newQuery(LeavePayout.class,crit); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if(c != null) leavePayouts.addAll(c); return leavePayouts; }
/** * @see org.kuali.kfs.module.endow.dataaccess.AutomatedCashInvestmentModelDao#getAutomatedCashInvestmentModelWithNextPayDateEqualToCurrentDate() */ public List<AutomatedCashInvestmentModel> getAutomatedCashInvestmentModelWithNextPayDateEqualToCurrentDate(Date currentDate) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.ACI_MODEL_NEXT_DUE_DATE, currentDate); criteria.addNotNull(EndowPropertyConstants.ACI_MODEL_FREQUENCY_CDOE); criteria.addEqualTo(EndowPropertyConstants.ACI_MODEL_ACTIVE_INDICATOR, "Y"); return (List<AutomatedCashInvestmentModel>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(AutomatedCashInvestmentModel.class, criteria)); }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionLockDao#getOrphanedFundingLocks(java.lang.String) */ public List<BudgetConstructionFundingLock> getOrphanedFundingLocks(String lockUnivId) { Criteria criteria = new Criteria(); if (StringUtils.isNotBlank(lockUnivId)) { criteria.addEqualTo(BCPropertyConstants.APPOINTMENT_FUNDING_LOCK_USER_ID, lockUnivId); } else { criteria.addNotNull(BCPropertyConstants.APPOINTMENT_FUNDING_LOCK_USER_ID); } ReportQueryByCriteria query = QueryFactory.newReportQuery(BudgetConstructionFundingLock.class, criteria); query.addOrderByAscending(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR); query.addOrderByAscending(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE); query.addOrderByAscending(KFSPropertyConstants.ACCOUNT_NUMBER); query.addOrderByAscending(KFSPropertyConstants.SUB_ACCOUNT_NUMBER); List<BudgetConstructionFundingLock> allFundingLocks = (List<BudgetConstructionFundingLock>) getPersistenceBrokerTemplate().getCollectionByQuery(query); List<BudgetConstructionFundingLock> orphanedFundingLocks = new ArrayList<BudgetConstructionFundingLock>(); for (BudgetConstructionFundingLock fundingLock : allFundingLocks) { String positionNumber = budgetConstructionDao.getPositionAssociatedWithFundingLock(fundingLock); if (BCConstants.POSITION_NUMBER_NOT_FOUND.equals(positionNumber)) { orphanedFundingLocks.add(fundingLock); } } return orphanedFundingLocks; }
/** * @see org.kuali.kfs.module.endow.dataaccess.CashSweepModelDao#getCashSweepModelWithNextPayDateEqualToCurrentDate() */ public List<CashSweepModel> getCashSweepModelWithNextPayDateEqualToCurrentDate(Date currentDate) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.CASH_SWEEP_MODEL_NEXT_DUE_DATE, currentDate); criteria.addNotNull(EndowPropertyConstants.CASH_SWEEP_MODEL_FREQUENCY_CDOE); criteria.addEqualTo(EndowPropertyConstants.CASH_SWEEP_MODEL_ACTIVE_INDICATOR, "Y"); return (List<CashSweepModel>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(CashSweepModel.class, criteria)); }
protected Iterator<Object[]> findLaborBaseFundsRawData(Map fieldValues, boolean isConsolidated) { Criteria criteria = OJBUtility.buildCriteriaFromMap(fieldValues, new AccountStatusBaseFunds()); criteria.addEqualTo(KFSPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE, KFSConstants.BALANCE_TYPE_BASE_BUDGET); criteria.addEqualToField(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR); criteria.addEqualToField(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE); criteria.addEqualToField(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.FINANCIAL_OBJECT_CODE, KFSPropertyConstants.FINANCIAL_OBJECT_CODE); // this statement is used to force OJB to join LABOR_OBJECT and GL_BALANCE tables criteria.addNotNull(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.FINANCIAL_OBJECT_FRINGE_OR_SALARY_CODE); ReportQueryByCriteria query = QueryFactory.newReportQuery(AccountStatusBaseFunds.class, criteria); List<String> groupByList = getGroupByList(isConsolidated); String[] groupBy = (String[]) groupByList.toArray(new String[groupByList.size()]); query.addGroupBy(groupBy); List<String> getAttributeList = getAttributeListForBaseFunds(isConsolidated, false); String[] attributes = (String[]) getAttributeList.toArray(new String[getAttributeList.size()]); query.setAttributes(attributes); return getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query); }
/** * @see org.kuali.kfs.module.endow.dataaccess.TicklerDao#getAllSecuritiesWithNextPayDateEqualToCurrentDate() */ public List<Tickler> getTicklerWithNextPayDateEqualToCurrentDate() { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.TICKLER_NEXT_DUE_DATE, kemService.getCurrentDate()); criteria.addNotNull(EndowPropertyConstants.TICKLER_FREQUENCY_CODE); criteria.addEqualTo(EndowPropertyConstants.TICKLER_ACTIVE_INDICATOR, "Y"); return (List<Tickler>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(Tickler.class, criteria)); }
/** * @see org.kuali.kfs.module.endow.dataaccess.TicklerDao#getAllSecuritiesWithNextPayDateEqualToCurrentDate() */ public List<EndowmentRecurringCashTransfer> getRecurringCashTransferWithNextPayDateEqualToCurrentDate() { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.ENDOWMENT_RECURRING_CASH_TRANSF_NEXT_PROC_DATE, kemService.getCurrentDate()); criteria.addNotNull(EndowPropertyConstants.ENDOWMENT_RECURRING_CASH_TRANSF_FREQUENCY_CODE); criteria.addEqualTo(EndowPropertyConstants.ENDOWMENT_RECURRING_CASH_TRANSF_ACTIVE_INDICATOR, "Y"); return (List<EndowmentRecurringCashTransfer>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(EndowmentRecurringCashTransfer.class, criteria)); }
/** * @see org.kuali.kfs.module.endow.dataaccess.FeeMethodDao#getSecuritiesWithNextPayDateEqualToCurrentDate() */ public List<FeeMethod> getFeeMethodWithNextPayDateEqualToCurrentDate() { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.FEE_METHOD_NEXT_PROCESS_DATE, kemService.getCurrentDate()); criteria.addNotNull(EndowPropertyConstants.FEE_METHOD_FREQUENCY_CODE); criteria.addEqualTo(EndowPropertyConstants.KUALICODEBASE_ACTIVE_INDICATOR, "Y"); return (List<FeeMethod>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(FeeMethod.class, criteria)); }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionLockDao#getAllAccountLocks(java.lang.String) */ public List<BudgetConstructionHeader> getAllAccountLocks(String lockUnivId) { Criteria criteria = new Criteria(); if (StringUtils.isNotBlank(lockUnivId)) { criteria.addEqualTo(BCPropertyConstants.BUDGET_LOCK_USER_IDENTIFIER, lockUnivId); } else { criteria.addNotNull(BCPropertyConstants.BUDGET_LOCK_USER_IDENTIFIER); } ReportQueryByCriteria query = QueryFactory.newReportQuery(BudgetConstructionHeader.class, criteria); query.addOrderByAscending(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR); query.addOrderByAscending(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE); query.addOrderByAscending(KFSPropertyConstants.ACCOUNT_NUMBER); query.addOrderByAscending(KFSPropertyConstants.SUB_ACCOUNT_NUMBER); return (List<BudgetConstructionHeader>) getPersistenceBrokerTemplate().getCollectionByQuery(query); }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionLockDao#getAllTransactionLocks(java.lang.String) */ public List<BudgetConstructionHeader> getAllTransactionLocks(String lockUnivId) { Criteria criteria = new Criteria(); if (StringUtils.isNotBlank(lockUnivId)) { criteria.addEqualTo(BCPropertyConstants.BUDGET_TRANSACTION_LOCK_USER_IDENTIFIER, lockUnivId); } else { criteria.addNotNull(BCPropertyConstants.BUDGET_TRANSACTION_LOCK_USER_IDENTIFIER); } ReportQueryByCriteria query = QueryFactory.newReportQuery(BudgetConstructionHeader.class, criteria); query.addOrderByAscending(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR); query.addOrderByAscending(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE); query.addOrderByAscending(KFSPropertyConstants.ACCOUNT_NUMBER); query.addOrderByAscending(KFSPropertyConstants.SUB_ACCOUNT_NUMBER); return (List<BudgetConstructionHeader>) getPersistenceBrokerTemplate().getCollectionByQuery(query); }
protected void clearHangingPositionLocks(Integer RequestYear) { BudgetConstructionPosition lockedPositions; Criteria criteriaID = new Criteria(); criteriaID.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, RequestYear); Criteria lockID = new Criteria(); if (BCConstants.DEFAULT_BUDGET_HEADER_LOCK_IDS == null) { // make sure that a NULL test is used in case = NULL is not supported // by the database lockID.addNotNull(BCPropertyConstants.POSITION_LOCK_USER_IDENTIFIER); } else { lockID.addNotEqualTo(BCPropertyConstants.POSITION_LOCK_USER_IDENTIFIER, BCConstants.DEFAULT_BUDGET_HEADER_LOCK_IDS); } ; criteriaID.addAndCriteria(lockID); // QueryByCriteria queryID = new QueryByCriteria(BudgetConstructionPosition.class, criteriaID); Iterator Results = getPersistenceBrokerTemplate().getIteratorByQuery(queryID); // now just loop through and change the locks while (Results.hasNext()) { lockedPositions = (BudgetConstructionPosition) Results.next(); lockedPositions.setPositionLockUserIdentifier(BCConstants.DEFAULT_BUDGET_HEADER_LOCK_IDS); getPersistenceBrokerTemplate().store(lockedPositions); } }
/** * @see org.kuali.kfs.module.ld.dataaccess.LaborDao#getJuly1PositionFunding(java.util.Map) */ public Collection<July1PositionFunding> getJuly1PositionFunding(Map<String, String> fieldValues) { Criteria criteria = OJBUtility.buildCriteriaFromMap(fieldValues, new July1PositionFunding()); criteria.addEqualToField(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR); criteria.addEqualToField(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE); criteria.addEqualToField(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.FINANCIAL_OBJECT_CODE, KFSPropertyConstants.FINANCIAL_OBJECT_CODE); criteria.addNotNull(KFSPropertyConstants.LABOR_OBJECT + "." + KFSPropertyConstants.FINANCIAL_OBJECT_FRINGE_OR_SALARY_CODE); QueryByCriteria query = QueryFactory.newQuery(July1PositionFunding.class, criteria); OJBUtility.limitResultSize(query); return getPersistenceBrokerTemplate().getCollectionByQuery(query); }
/** 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); } }