/** * @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionOrganizationReportsDao#getBySearchCriteria(java.lang.Class, java.util.Map) */ public Collection getBySearchCriteria(Class cls, Map searchCriteria) { Criteria criteria = new Criteria(); for (Iterator iter = searchCriteria.keySet().iterator(); iter.hasNext();) { String element = (String) iter.next(); criteria.addEqualTo(element, searchCriteria.get(element)); } QueryByCriteria qbc = QueryFactory.newQuery(cls, criteria); return getPersistenceBrokerTemplate().getCollectionByQuery(qbc); }
protected Iterator<Object[]> findBalanceSummaryRawData(Criteria criteria) { ReportQueryByCriteria query = QueryFactory.newReportQuery(LedgerBalance.class, criteria); List<String> groupByList = this.getGroupByListForBalanceSummary(); String[] groupBy = (String[]) groupByList.toArray(new String[groupByList.size()]); query.addGroupBy(groupBy); List<String> getAttributeList = this.getAttributeListForBalanceSummary(false); String[] attributes = (String[]) getAttributeList.toArray(new String[getAttributeList.size()]); query.setAttributes(attributes); query.addOrderByAscending(groupByList.get(0)); return getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query); }
/** * @see org.kuali.rice.krad.dao.BusinessObjectDao#retrieve(org.kuali.rice.krad.bo.PersistableBusinessObject) */ public Object retrieve(Object object) { return getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQueryByIdentity(object)); }
/** * Retrieves all of the records for a given class name. * * @param clazz - the name of the object being used, either KualiCodeBase or a subclass * @return Collection * @see org.kuali.rice.krad.dao.BusinessObjectDao#findAll(java.lang.Class) */ public <T extends BusinessObject> Collection<T> findAll(Class<T> clazz) { return (Collection<T>)getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(clazz, (Criteria) null)); }
protected Iterator<Object[]> findFundsRawData(Criteria criteria) { ReportQueryByCriteria query = QueryFactory.newReportQuery(LedgerBalance.class, criteria); List<String> groupByList = this.getGroupByListForFundingInquiry(); String[] groupBy = (String[]) groupByList.toArray(new String[groupByList.size()]); query.addGroupBy(groupBy); List<String> getAttributeList = getAttributeListForFundingInquiry(false); String[] attributes = (String[]) getAttributeList.toArray(new String[getAttributeList.size()]); query.setAttributes(attributes); OJBUtility.limitResultSize(query); return getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query); }
/** * build the query for encumbrance search * * @param fieldValues a Map of values to use as keys for the query * @return an OJB query */ protected Query getOpenEncumbranceQuery(Map fieldValues) { Criteria criteria = OJBUtility.buildCriteriaFromMap(fieldValues, new Encumbrance()); criteria.addIn(KFSPropertyConstants.BALANCE_TYPE_CODE, Arrays.asList(KFSConstants.ENCUMBRANCE_BALANCE_TYPE)); return QueryFactory.newQuery(Encumbrance.class, criteria); }
/** * @see org.kuali.kfs.gl.dataaccess.EncumbranceDao#findCountGreaterOrEqualThan(java.lang.Integer) */ public Integer findCountGreaterOrEqualThan(Integer year) { Criteria criteria = new Criteria(); criteria.addGreaterOrEqualThan(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year); ReportQueryByCriteria query = QueryFactory.newReportQuery(Encumbrance.class, criteria); return getPersistenceBrokerTemplate().getCount(query); } }
/** * @see org.kuali.kfs.coa.dataaccess.ChartDao#getAll() */ public Collection getAll() { QueryByCriteria qbc = QueryFactory.newQuery(Chart.class, (Criteria) null); qbc.addOrderByAscending("chartOfAccountsCode"); Collection charts = getPersistenceBrokerTemplate().getCollectionByQuery(qbc); List chartList = new ArrayList(charts); return chartList; }
/** * @see org.kuali.kfs.gl.dataaccess.AccountBalanceDao#findCountGreaterOrEqualThan(java.lang.Integer) */ public Integer findCountGreaterOrEqualThan(Integer year) { Criteria criteria = new Criteria(); criteria.addGreaterOrEqualThan(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year); ReportQueryByCriteria query = QueryFactory.newReportQuery(AccountBalance.class, criteria); return getPersistenceBrokerTemplate().getCount(query); }
@Override public List<ClassificationDutyBo> getDutyListForClassification(String pmClassificationId) { List<ClassificationDutyBo> dutyList = new ArrayList<ClassificationDutyBo>(); Criteria crit = new Criteria(); crit.addEqualTo("pmPositionClassId", pmClassificationId); Query query = QueryFactory.newQuery(ClassificationDutyBo.class, crit); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if (c != null) { dutyList.addAll(c); } return dutyList; }
/** * @see org.kuali.kfs.gl.dataaccess.LedgerEntryBalancingDao#findCountGreaterOrEqualThan(java.lang.Integer) */ public Integer findCountGreaterOrEqualThan(Integer year) { Criteria criteria = new Criteria(); criteria.addGreaterOrEqualThan(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year); ReportQueryByCriteria query = QueryFactory.newReportQuery(Entry.class, criteria); return getPersistenceBrokerTemplate().getCount(query); } }
@Override public List<ClassificationFlagBo> getFlagListForClassification(String pmClassificationId) { List<ClassificationFlagBo> flagList = new ArrayList<ClassificationFlagBo>(); Criteria crit = new Criteria(); crit.addEqualTo("pmPositionClassId", pmClassificationId); Query query = QueryFactory.newQuery(ClassificationFlagBo.class, crit); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if (c != null) { flagList.addAll(c); } return flagList; }
/** * @see org.kuali.kfs.gl.dataaccess.BalancingDao#findCountGreaterOrEqualThan(java.lang.Integer) */ public Integer findCountGreaterOrEqualThan(Integer year) { Criteria criteria = new Criteria(); criteria.addGreaterOrEqualThan(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year); ReportQueryByCriteria query = QueryFactory.newReportQuery(Balance.class, criteria); return getPersistenceBrokerTemplate().getCount(query); }
@Override public List<BalanceTransfer> getAllBalanceTransfersForPrincipalId( String principalId) { Criteria crit = new Criteria(); List<BalanceTransfer> balanceTransfers = new ArrayList<BalanceTransfer>(); crit.addEqualTo("principalId",principalId); Query query = QueryFactory.newQuery(BalanceTransfer.class,crit); Collection c = this.getPersistenceBrokerTemplate().getCollectionByQuery(query); if(c != null) balanceTransfers.addAll(c); return balanceTransfers; }
/** * @see org.kuali.kfs.gl.dataaccess.BalancingDao#findCountGreaterOrEqualThan(java.lang.Integer) */ public Integer findCountGreaterOrEqualThan(Integer year) { Criteria criteria = new Criteria(); criteria.addGreaterOrEqualThan(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year); ReportQueryByCriteria query = QueryFactory.newReportQuery(LedgerBalance.class, criteria); return getPersistenceBrokerTemplate().getCount(query); } }
/** * This is the default impl that comes with Kuali - uses OJB. * * @see org.kuali.rice.krad.dao.BusinessObjectDao#countMatching(java.lang.Class, java.util.Map) */ public int countMatching(Class clazz, Map<String, ?> fieldValues) { Criteria criteria = buildCriteria(fieldValues); return getPersistenceBrokerTemplate().getCount(QueryFactory.newQuery(clazz, criteria)); }
/** * @see org.kuali.kfs.gl.dataaccess.LedgerEntryBalancingDao#findCountGreaterOrEqualThan(java.lang.Integer) */ public Integer findCountGreaterOrEqualThan(Integer year) { Criteria criteria = new Criteria(); criteria.addGreaterOrEqualThan(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year); ReportQueryByCriteria query = QueryFactory.newReportQuery(getEntryClass(), criteria); return getPersistenceBrokerTemplate().getCount(query); }
/** * fetch all encumbrance records from GL open encumbrance table * * @return an Iterator with all encumbrances currently in the database * @see org.kuali.kfs.gl.dataaccess.EncumbranceDao#getAllEncumbrances() */ public Iterator getAllEncumbrances() { Criteria criteria = new Criteria(); QueryByCriteria query = QueryFactory.newQuery(Encumbrance.class, criteria); return getPersistenceBrokerTemplate().getIteratorByQuery(query); }
protected Query getBalanceQuery(Map fieldValues, boolean isConsolidated) { LOG.debug("getBalanceQuery(Map, boolean) started"); LOG.debug("Building criteria from map fields: " + fieldValues.keySet()); Criteria criteria = buildCriteriaFromMap(fieldValues, new LedgerBalance()); ReportQueryByCriteria query = QueryFactory.newReportQuery(LedgerBalance.class, criteria); // if consolidated, then ignore subaccount number and balance type code if (isConsolidated) { buildConsolidatedQuery(query, sum(JULY.propertyName), sum(AUGUST.propertyName), sum(SEPTEMBER.propertyName), sum(OCTOBER.propertyName), sum(NOVEMBER.propertyName), sum(DECEMBER.propertyName), sum(JANUARY.propertyName), sum(FEBRUARY.propertyName), sum(MARCH.propertyName), sum(APRIL.propertyName), sum(MAY.propertyName), sum(JUNE.propertyName), sum(YEAR_END.propertyName)); } return query; }
/** * @see org.kuali.kfs.module.cg.dataaccess.AwardDao#deleteAll() */ public void deleteAll() { getPersistenceBrokerTemplate().deleteByQuery(QueryFactory.newQuery(Award.class, new Criteria())); }