protected String buildObjectCodeCachingKey(ObjectCode objectCode) { return objectCode.getUniversityFiscalYear() + KRADConstants.Maintenance.LOCK_AFTER_VALUE_DELIM + objectCode.getChartOfAccountsCode() + KRADConstants.Maintenance.LOCK_AFTER_VALUE_DELIM + objectCode.getFinancialObjectCode(); }
protected Collection<SubObjectCode> getAssociatedSubObjects(ObjectCode objectCode) { Map<String, Object> fieldValues = new HashMap<String, Object>(); fieldValues.put( KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, objectCode.getUniversityFiscalYear()); fieldValues.put( KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, objectCode.getChartOfAccountsCode()); fieldValues.put( KFSPropertyConstants.FINANCIAL_OBJECT_CODE, objectCode.getFinancialObjectCode()); return businessObjectService.findMatching(SubObjectCode.class, fieldValues); }
@Override protected Map<String, String> buildInactivationBlockerQueryMap( BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) { ObjectCode blockedObjectCode = (ObjectCode) blockedBo; if (universityDateService .getCurrentFiscalYear() .equals(blockedObjectCode.getUniversityFiscalYear())) { return super.buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata); } return null; }
protected boolean isInactivatingObjectCode(ObjectCode objectCode) { ObjectCodeService objectCodeService = SpringContext.getBean(ObjectCodeService.class); if (!objectCode.isActive()) { ObjectCode objectCodeFromDB = objectCodeService.getByPrimaryId( objectCode.getUniversityFiscalYear(), objectCode.getChartOfAccountsCode(), objectCode.getFinancialObjectCode()); if (objectCodeFromDB != null && objectCodeFromDB.isActive()) { return true; } } return false; }
/** * @see org.kuali.kfs.coa.dataaccess.ObjectCodeDao#getYearList(java.lang.String, java.lang.String) */ public List getYearList(String chartOfAccountsCode, String financialObjectCode) { List returnList = new ArrayList(); Criteria criteria = new Criteria(); criteria.addEqualTo("chartOfAccountsCode", chartOfAccountsCode); criteria.addEqualTo("financialObjectCode", financialObjectCode); Collection years = getPersistenceBrokerTemplate() .getCollectionByQuery(QueryFactory.newQuery(ObjectCode.class, criteria)); for (Iterator iter = years.iterator(); iter.hasNext(); ) { ObjectCode o = (ObjectCode) iter.next(); if (o != null) { returnList.add(o.getUniversityFiscalYear()); } } return returnList; }