/** * @see org.kuali.kfs.fp.document.dataaccess.CashManagementDao#findRecentlyClosedItemsInProcess(java.lang.String) */ public List<CashieringItemInProcess> findRecentlyClosedItemsInProcess(String campusCode) { List<CashieringItemInProcess> closedItems = new ArrayList<CashieringItemInProcess>(); Criteria criteria = new Criteria(); criteria.addEqualTo("campusCode", campusCode); criteria.addColumnNotNull("ITM_CLOSED_DT"); Calendar thirtyDaysAgo = new GregorianCalendar(); thirtyDaysAgo.add(Calendar.DAY_OF_YEAR, -30); criteria.addGreaterThan("itemClosedDate", new java.sql.Date(thirtyDaysAgo.getTimeInMillis())); QueryByCriteria closedItemsQuery = QueryFactory.newQuery(CashieringItemInProcess.class, criteria); Iterator iter = getPersistenceBrokerTemplate().getIteratorByQuery(closedItemsQuery); while (iter.hasNext()) { closedItems.add((CashieringItemInProcess) iter.next()); } return closedItems; }
/** * @see org.kuali.kfs.module.purap.document.dataaccess.NegativePaymentRequestApprovalLimitDao#findAboveLimit(org.kuali.rice.kns.util.KualiDecimal) */ public Collection<NegativePaymentRequestApprovalLimit> findAboveLimit(KualiDecimal limit) { LOG.debug("Entering findAboveLimit(KualiDecimal)"); Criteria criteria = new Criteria(); criteria.addGreaterThan("negativePaymentRequestApprovalLimitAmount", limit); criteria.addAndCriteria(buildActiveCriteria()); Query query = new QueryByCriteria(NegativePaymentRequestApprovalLimit.class, criteria); LOG.debug("Leaving findAboveLimit(KualiDecimal)"); return getPersistenceBrokerTemplate().getCollectionByQuery(query); }
/** * @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionDao#getBudgetConstructionPullupFlagSetByUserId(java.lang.String) */ public List<BudgetConstructionPullup> getBudgetConstructionPullupFlagSetByUserId(String principalName) { List<BudgetConstructionPullup> orgs = new ArrayList<BudgetConstructionPullup>(); Criteria criteria = new Criteria(); criteria.addEqualTo(KFSPropertyConstants.KUALI_USER_PERSON_UNIVERSAL_IDENTIFIER, principalName); criteria.addGreaterThan("pullFlag", OrgSelControlOption.NO.getKey()); orgs = (List<BudgetConstructionPullup>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(BudgetConstructionPullup.class, criteria)); if (orgs.isEmpty() || orgs.size() == 0) { return (List<BudgetConstructionPullup>)Collections.EMPTY_LIST; } return orgs; }
public TimesheetDocumentHeader getDocumentHeaderForDate(String principalId, DateTime asOfDate) { Criteria crit = new Criteria(); crit.addEqualTo("principalId", principalId); crit.addLessOrEqualThan("beginDate", asOfDate.toDate()); crit.addGreaterThan("endDate", asOfDate.toDate()); QueryByCriteria query = new QueryByCriteria(TimesheetDocumentHeader.class, crit); return (TimesheetDocumentHeader) this.getPersistenceBrokerTemplate().getObjectByQuery(query); } }
/** * @see org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getTransactionArchivesCountByETranCode(String, long) */ public long getTransactionArchivesCountByETranCode(String feeMethodCode, Date transactionPostedDate) { long totalTransactionArchives = 0; Criteria criteria = new Criteria(); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_ETRAN_CODE, getETranCodes(feeMethodCode)); criteria.addGreaterThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, transactionPostedDate); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); totalTransactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query).size(); return totalTransactionArchives; }
/** * @see org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getTransactionArchivesCountByETranCode(String, long) */ public long getTransactionArchivesCountByETranCode(String feeMethodCode, Date transactionPostedDate) { long totalTransactionArchives = 0; Criteria criteria = new Criteria(); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_ETRAN_CODE, getETranCodes(feeMethodCode)); criteria.addGreaterThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, transactionPostedDate); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); totalTransactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query).size(); return totalTransactionArchives; }
/** * @see org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getTransactionArchivesCountByDocumentTypeName(String, long) */ public long getTransactionArchivesCountByDocumentTypeName(String feeMethodCode, Date transactionPostedDate) { long totalTransactionArchives = 0; Criteria criteria = new Criteria(); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_TYPE_CODE, getTypeCodes(feeMethodCode)); criteria.addGreaterThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, transactionPostedDate); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); totalTransactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query).size(); return totalTransactionArchives; }
/** * @see org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getTransactionArchivesCountByDocumentTypeName(String, long) */ public long getTransactionArchivesCountByDocumentTypeName(String feeMethodCode, Date transactionPostedDate) { long totalTransactionArchives = 0; Criteria criteria = new Criteria(); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_TYPE_CODE, getTypeCodes(feeMethodCode)); criteria.addGreaterThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, transactionPostedDate); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); totalTransactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query).size(); return totalTransactionArchives; }
public List<HoldingHistory> getHoldingHistoryByKemidIdAndMonthEndIdAndIpInd(String kemid, KualiInteger monthEndId, String ipInd) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.HOLDING_HISTORY_KEMID, kemid); criteria.addEqualTo(EndowPropertyConstants.HOLDING_HISTORY_MONTH_END_DATE_ID, monthEndId); criteria.addGreaterThan(EndowPropertyConstants.HOLDING_TAX_LOT_UNITS, BigDecimal.ZERO); if (ipInd.equalsIgnoreCase(IncomePrincipalIndicator.INCOME) || ipInd.equalsIgnoreCase(IncomePrincipalIndicator.PRINCIPAL)) { criteria.addEqualTo(EndowPropertyConstants.HOLDING_HISTORY_INCOME_PRINCIPAL_INDICATOR, ipInd); } QueryByCriteria qbc = QueryFactory.newQuery(HoldingHistory.class, criteria); qbc.addOrderByAscending(EndowPropertyConstants.KEMID); return (List<HoldingHistory>) getPersistenceBrokerTemplate().getCollectionByQuery(qbc); }
/** * @see org.kuali.kfs.module.endow.dataaccess.HoldingTaxLotDao#getTaxLotsPerSecurityIDWithUnitsGreaterThanZero(java.lang.String) */ public List<HoldingTaxLot> getTaxLotsPerSecurityIDWithUnitsGreaterThanZero(String securityId) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_SECURITY_ID, securityId); criteria.addGreaterThan(EndowPropertyConstants.HOLDING_TAX_LOT_UNITS, 0); return (List<HoldingTaxLot>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(HoldingTaxLot.class, criteria)); } }
/** * Builds a criteria to find non-expired accounts * @return a Criteria for non-expired accounts */ protected Criteria getAccountNotExpiredCriteria() { Criteria criteria = new Criteria(); criteria.addIsNull("accountExpirationDate"); Criteria notYetExpiredCriteria = new Criteria(); notYetExpiredCriteria.addGreaterThan("accountExpirationDate", dateTimeService.getCurrentSqlDate()); criteria.addOrCriteria(notYetExpiredCriteria); return criteria; }
/** * @see org.kuali.kfs.module.endow.dataaccess.SecurityDao#getSecuritiesByClassCodeWithUnitsGreaterThanZero(java.lang.String[]) */ public List<Security> getSecuritiesByClassCodeWithUnitsGreaterThanZero(List<String> classCodes) { Criteria criteria = new Criteria(); criteria.addIn(EndowPropertyConstants.SECURITY_CLASS_CODE, classCodes); criteria.addGreaterThan(EndowPropertyConstants.SECURITY_UNITS_HELD, 0); return (List<Security>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(Security.class, criteria)); }
/** * @see org.kuali.kfs.module.endow.dataaccess.HoldingTaxLotDao#getTaxLotsWithAccruedIncomeGreaterThanZeroPerSecurity(java.lang.String) */ public List<HoldingTaxLot> getTaxLotsWithAccruedIncomeGreaterThanZeroPerSecurity(String securityId) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_SECURITY_ID, securityId); criteria.addGreaterThan(EndowPropertyConstants.HOLDING_TAX_LOT_ACRD_INC_DUE, 0); return (List<HoldingTaxLot>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(HoldingTaxLot.class, criteria)); }
@Override public List<LeaveBlockBo> getLeaveBlocks(String principalId, String leaveBlockType, String requestStatus, LocalDate currentDate) { List<LeaveBlockBo> leaveBlocks = new ArrayList<LeaveBlockBo>(); Criteria root = new Criteria(); root.addEqualTo("principalId", principalId); root.addEqualTo("leaveBlockType", leaveBlockType); root.addEqualTo("requestStatus", requestStatus); if(currentDate != null) { root.addGreaterThan("leaveDate", currentDate.toDate()); } Query query = QueryFactory.newQuery(LeaveBlockBo.class, root); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if(c!= null) { leaveBlocks.addAll(c); } return leaveBlocks; }
/** * @see org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getTransactionArchivesCountByDocumentTypeNameAndETranCode(String, long) */ public long getTransactionArchivesCountByDocumentTypeNameAndETranCode(String feeMethodCode, Date transactionPostedDate) { long totalTransactionArchives = 0; Criteria criteria = new Criteria(); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_TYPE_CODE, getTypeCodes(feeMethodCode)); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_ETRAN_CODE, getETranCodes(feeMethodCode)); criteria.addGreaterThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, transactionPostedDate); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); totalTransactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query).size(); return totalTransactionArchives; }
/** * @see org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getTransactionArchivesCountByDocumentTypeNameAndETranCode(String, long) */ public long getTransactionArchivesCountByDocumentTypeNameAndETranCode(String feeMethodCode, Date transactionPostedDate) { long totalTransactionArchives = 0; Criteria criteria = new Criteria(); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_TYPE_CODE, getTypeCodes(feeMethodCode)); criteria.addIn(EndowPropertyConstants.TRANSACTION_ARCHIVE_ETRAN_CODE, getETranCodes(feeMethodCode)); criteria.addGreaterThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, transactionPostedDate); QueryByCriteria query = QueryFactory.newQuery(TransactionArchive.class, criteria); totalTransactionArchives = getPersistenceBrokerTemplate().getCollectionByQuery(query).size(); return totalTransactionArchives; }
/** * @see org.kuali.kfs.module.cab.batch.dataaccess.ExtractDao#findCreditMemoAccountHistory(org.kuali.kfs.module.cab.businessobject.BatchParameters) */ public Collection<CreditMemoAccountRevision> findCreditMemoAccountRevisions(BatchParameters batchParameters) { Criteria criteria = new Criteria(); criteria.addGreaterThan(CabPropertyConstants.CreditMemoAccountRevision.ACCOUNT_REVISION_TIMESTAMP, batchParameters.getLastRunTime()); if (!batchParameters.getExcludedChartCodes().isEmpty()) criteria.addNotIn(CabPropertyConstants.CreditMemoAccountRevision.CHART_OF_ACCOUNTS_CODE, batchParameters.getExcludedChartCodes()); if (!batchParameters.getExcludedSubFundCodes().isEmpty()) criteria.addNotIn(CabPropertyConstants.CreditMemoAccountRevision.ACCOUNT_SUB_FUND_GROUP_CODE, batchParameters.getExcludedSubFundCodes()); if (!batchParameters.getIncludedFinancialObjectSubTypeCodes().isEmpty()) criteria.addIn(CabPropertyConstants.CreditMemoAccountRevision.FINANCIAL_OBJECT_FINANCIAL_OBJECT_SUB_TYPE_CODE, batchParameters.getIncludedFinancialObjectSubTypeCodes()); QueryByCriteria query = new QueryByCriteria(CreditMemoAccountRevision.class, criteria); query.addOrderByAscending(CabPropertyConstants.CreditMemoAccountRevision.ACCOUNT_REVISION_TIMESTAMP); Collection<CreditMemoAccountRevision> historyRecs = getPersistenceBrokerTemplate().getCollectionByQuery(query); return historyRecs; }
/** * @see org.kuali.kfs.module.endow.dataaccess.HoldingTaxLotDao#getAllTaxLotsWithPositiveUnits(java.lang.String, * java.lang.String, java.lang.String, java.lang.String) */ public Collection<HoldingTaxLot> getAllTaxLotsWithPositiveUnits(String kemid, String securityId, String registrationCode, String incomePrincipalIndicator) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_KEMID, kemid); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_SECURITY_ID, securityId); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_REGISTRATION_CODE, registrationCode); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_INCOME_PRINCIPAL_INDICATOR, incomePrincipalIndicator); criteria.addGreaterThan(EndowPropertyConstants.HOLDING_TAX_LOT_UNITS, 0); return (Collection<HoldingTaxLot>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(HoldingTaxLot.class, criteria)); }
/** * @see org.kuali.kfs.module.endow.dataaccess.HoldingTaxLotDao#getAllTaxLotsWithPositiveAmounts(java.lang.String, * java.lang.String, java.lang.String, java.lang.String) */ public Collection<HoldingTaxLot> getAllTaxLotsWithPositiveCost(String kemid, String securityId, String registrationCode, String incomePrincipalIndicator) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_KEMID, kemid); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_SECURITY_ID, securityId); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_REGISTRATION_CODE, registrationCode); criteria.addEqualTo(EndowPropertyConstants.HOLDING_TAX_LOT_INCOME_PRINCIPAL_INDICATOR, incomePrincipalIndicator); criteria.addGreaterThan(EndowPropertyConstants.HOLDING_TAX_LOT_COST, 0); return (Collection<HoldingTaxLot>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(HoldingTaxLot.class, criteria)); }
/** * @see org.kuali.kfs.module.endow.dataaccess.IncomeDistributionForPooledFundDao#getKemidPayoutInstructionForECT(java.lang.String) */ public List<KemidPayoutInstruction> getKemidPayoutInstructionForECT(String kemid, Date currentDate) { Criteria crit = new Criteria(); Criteria crit2 = new Criteria(); Criteria crit21 = new Criteria(); crit.addEqualTo(EndowPropertyConstants.KEMID_PAY_INC_KEMID, kemid); crit.addNotEqualTo(EndowPropertyConstants.KEMID_PAY_INC_TO_KEMID, kemid); crit.addLessOrEqualThan(EndowPropertyConstants.KEMID_PAY_INC_START_DATE, currentDate); crit2.addGreaterThan(EndowPropertyConstants.KEMID_PAY_INC_END_DATE, currentDate); crit21.addIsNull(EndowPropertyConstants.KEMID_PAY_INC_END_DATE); crit2.addOrCriteria(crit21); crit.addAndCriteria(crit2); return (List<KemidPayoutInstruction>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(KemidPayoutInstruction.class, crit)); }