/** * Fetches all reversals that have been set to reverse on or before the given date - that is to say, * returns all the reversal records ready to be reversed! * * @param before the date that reversals must reverse on or before * @return an Iterator of reversal records to reverse * @see org.kuali.kfs.gl.dataaccess.ReversalDao#getByDate(java.util.Date) */ public Iterator getByDate(Date before) { LOG.debug("getByDate() started"); Criteria crit = new Criteria(); crit.addLessOrEqualThan(KFSPropertyConstants.FINANCIAL_DOCUMENT_REVERSAL_DATE, new java.sql.Date(before.getTime())); QueryByCriteria qbc = QueryFactory.newQuery(Reversal.class, crit); return getPersistenceBrokerTemplate().getIteratorByQuery(qbc); }
/** * 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; }
/** * Get all the groups that are older than a date * * @param day the date groups returned should be older than * @return a Collection of origin entry groups older than that date * @see org.kuali.kfs.gl.dataaccess.OriginEntryGroupDao#getOlderGroups(Date) */ public Collection<OriginEntryGroup> getOlderGroups(Date day) { LOG.debug("getOlderGroups() started"); Criteria criteria = new Criteria(); criteria.addLessOrEqualThan(DATE, day); return getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(OriginEntryGroup.class, criteria)); }
/** * @see org.kuali.kfs.pdp.dataaccess.PaymentDetailDao#getDisbursementNumberRanges(java.lang.String) */ public List<DisbursementNumberRange> getDisbursementNumberRanges(String campus) { LOG.debug("getDisbursementNumberRanges() started"); Date now = new Date(); Timestamp nowTs = new Timestamp(now.getTime()); Criteria criteria = new Criteria(); criteria.addLessOrEqualThan(PdpPropertyConstants.DISBURSEMENT_NUMBER_RANGE_START_DATE, nowTs); criteria.addEqualTo(PdpPropertyConstants.PHYS_CAMPUS_PROC_CODE, campus); criteria.addEqualTo(KFSPropertyConstants.ACTIVE, true); QueryByCriteria qbc = new QueryByCriteria(DisbursementNumberRange.class, criteria); qbc.addOrderBy(KFSPropertyConstants.BANK_CODE, true); return (List<DisbursementNumberRange>) getPersistenceBrokerTemplate().getCollectionByQuery(qbc); }
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.fp.document.dataaccess.TravelMileageRateDao#retrieveMostEffectiveMileageRates(java.sql.Timestamp) */ public Collection retrieveMostEffectiveMileageRates(Date effectiveDate) { Criteria criteria = new Criteria(); criteria.addLessOrEqualThan("disbursementVoucherMileageEffectiveDate", effectiveDate); QueryByCriteria queryByCriteria = new QueryByCriteria(TravelMileageRate.class, criteria); queryByCriteria.addOrderByDescending("disbursementVoucherMileageEffectiveDate"); queryByCriteria.addOrderByDescending("mileageLimitAmount"); Collection mostEffectiveRates = new ArrayList(); Collection rates = getPersistenceBrokerTemplate().getCollectionByQuery(queryByCriteria); Date mostEffectiveDate = ((TravelMileageRate) rates.iterator().next()).getDisbursementVoucherMileageEffectiveDate(); for (Iterator iter = rates.iterator(); iter.hasNext();) { TravelMileageRate rate = (TravelMileageRate) iter.next(); if (rate.getDisbursementVoucherMileageEffectiveDate().compareTo(mostEffectiveDate) == 0) { mostEffectiveRates.add(rate); } } return mostEffectiveRates; }
@SuppressWarnings("rawtypes") @Override public List<LeaveBlockBo> getLeaveBlocks(String principalId, LocalDate beginDate, LocalDate endDate) { 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("active", true); Query query = QueryFactory.newQuery(LeaveBlockBo.class, root); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if (c != null) { leaveBlocks.addAll(c); } return leaveBlocks; }
@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; }
@Override public List<LeaveBlockBo> getAccrualGeneratedLeaveBlocks(String principalId, LocalDate beginDate, LocalDate endDate) { 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("accrualGenerated", "Y"); 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.cg.dataaccess.ProposalDao#getProposalsToClose(org.kuali.kfs.module.cg.businessobject.Close) */ public Collection<Proposal> getProposalsToClose(ProposalAwardCloseDocument close) { Criteria criteria = new Criteria(); criteria.addIsNull("proposalClosingDate"); criteria.addLessOrEqualThan("proposalSubmissionDate", close.getCloseOnOrBeforeDate()); return (Collection<Proposal>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(Proposal.class, criteria)); }
/** * * @see org.kuali.kfs.module.endow.dataaccess.KemidHistoricalCashDao#getKemidsFromHistoryCash(java.lang.String, org.kuali.rice.kns.util.KualiInteger, org.kuali.rice.kns.util.KualiInteger) */ public List<KemidHistoricalCash> getKemidsFromHistoryCash(String kemid, KualiInteger beginningMed, KualiInteger endingMed) { Criteria criteria = new Criteria(); if (kemid != null && !kemid.isEmpty()) { criteria.addGreaterOrEqualThanField(EndowPropertyConstants.KEMID, kemid); } criteria.addGreaterOrEqualThanField(EndowPropertyConstants.ENDOWMENT_HIST_CASH_MED_ID, beginningMed); criteria.addLessOrEqualThan(EndowPropertyConstants.ENDOWMENT_HIST_CASH_MED_ID, endingMed); QueryByCriteria qbc = QueryFactory.newQuery(KemidHistoricalCash.class, criteria); qbc.addOrderByAscending(EndowPropertyConstants.ENDOWMENT_HIST_CASH_KEMID); return (List<KemidHistoricalCash>) getPersistenceBrokerTemplate().getCollectionByQuery(qbc); } }
@Override public List<LeaveBlockBo> getLeaveBlocks(String principalId, String accrualCategory, LocalDate beginDate, LocalDate endDate) { 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; }
@SuppressWarnings("rawtypes") @Override public List<LeaveBlockBo> getLeaveBlocksWithType(String principalId, LocalDate beginDate, LocalDate endDate, String leaveBlockType) { 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("leaveBlockType", leaveBlockType); // 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; }
/** * Get all the groups to be copied into the backup group * * @param groupDate the date returned origin entry groups must have been created on or before * @return a Collection of origin entry groups to backup * @see org.kuali.kfs.gl.dataaccess.OriginEntryGroupDao#getScrubberGroups(java.sql.Date) */ public Collection getGroupsToBackup(Date groupDate) { LOG.debug("getGroupsToBackup() started"); Criteria criteria = new Criteria(); criteria.addLessOrEqualThan(DATE, groupDate); criteria.addEqualTo(SCRUB, Boolean.TRUE); criteria.addEqualTo(PROCESS, Boolean.TRUE); criteria.addEqualTo(VALID, Boolean.TRUE); QueryByCriteria qbc = QueryFactory.newQuery(OriginEntryGroup.class, criteria); return getPersistenceBrokerTemplate().getCollectionByQuery(qbc); }
@Override public List<LeavePayout> getLeavePayouts(String viewPrincipal, LocalDate beginPeriodDate, LocalDate endPeriodDate) { // TODO Auto-generated method stub List<LeavePayout> leavePayouts = new ArrayList<LeavePayout>(); 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(LeavePayout.class,crit); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if(c != null) leavePayouts.addAll(c); return leavePayouts; }
@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; }
@Override public List<LeaveBlockBo> getLeaveBlocks(LocalDate leaveDate, String accrualCategory, String principalId) { Criteria root = new Criteria(); root.addLessOrEqualThan("leaveDate", leaveDate.toDate()); root.addEqualTo("accrualCategory", accrualCategory); root.addEqualTo("principalId", principalId); Query query = QueryFactory.newQuery(LeaveBlockBo.class, root); List<LeaveBlockBo> leaveBlocks = (List<LeaveBlockBo>) this.getPersistenceBrokerTemplate().getCollectionByQuery(query); return leaveBlocks; }
/** * @see org.kuali.kfs.module.cg.dataaccess.AwardDao#getAwardsToClose(org.kuali.kfs.module.cg.businessobject.Close) */ public Collection<Award> getAwardsToClose(ProposalAwardCloseDocument close) { Criteria criteria = new Criteria(); criteria.addIsNull("awardClosingDate"); criteria.addLessOrEqualThan("awardEntryDate", close.getCloseOnOrBeforeDate()); criteria.addNotEqualTo("awardStatusCode", "U"); return (Collection<Award>) getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(Award.class, criteria)); }
/** * * @see org.kuali.kfs.module.endow.dataaccess.TransactionArchiveDao#getTransactionArchiveByKemidsAndPostedDate(java.lang.String, java.lang.String, java.util.Date, java.util.Date, java.lang.String, java.lang.String) */ public List<TransactionArchive> getTransactionArchiveByKemidsAndPostedDate(String kemid, String endowmentOption, java.util.Date beginningDate, java.util.Date endingDate, String closedIndicator, String transactionSubType) { Criteria criteria = new Criteria(); criteria.addEqualTo(EndowPropertyConstants.TRANSACTION_ARCHIVE_KEM_ID, kemid); criteria.addEqualTo(EndowPropertyConstants.TRANSACTION_ARCHIVE_SUB_TYPE_CODE, transactionSubType); criteria.addGreaterOrEqualThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, beginningDate); criteria.addLessOrEqualThan(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE, endingDate); QueryByCriteria qbc = QueryFactory.newQuery(TransactionArchive.class, criteria); qbc.addOrderByAscending(EndowPropertyConstants.TRANSACTION_ARCHIVE_POSTED_DATE); return (List<TransactionArchive>) getPersistenceBrokerTemplate().getCollectionByQuery(qbc); }
/** * @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)); }