/** This method sets the object code on each detail object in the collection */ @Override protected void prepareGlobalsForSave() { // copy the object code down from the header into the details ObjectCodeGlobal objectCodeGlobal = (ObjectCodeGlobal) getBusinessObject(); for (ObjectCodeGlobalDetail detail : objectCodeGlobal.getObjectCodeGlobalDetails()) { detail.setFinancialObjectCode(objectCodeGlobal.getFinancialObjectCode()); } super.prepareGlobalsForSave(); }
protected Map<String, Boolean> buildObjectCodeActiveStatusCache( ObjectCodeGlobal objectCodeGlobal) { ObjectCodeService objectCodeService = SpringContext.getBean(ObjectCodeService.class); Map<String, Boolean> cache = new HashMap<String, Boolean>(); for (ObjectCodeGlobalDetail detail : objectCodeGlobal.getObjectCodeGlobalDetails()) { ObjectCode objectCodeFromDB = objectCodeService.getByPrimaryId( detail.getUniversityFiscalYear(), detail.getChartOfAccountsCode(), objectCodeGlobal.getFinancialObjectCode()); if (ObjectUtils.isNotNull(objectCodeFromDB)) { cache.put( buildObjectCodeCachingKey(objectCodeFromDB), Boolean.valueOf(objectCodeFromDB.isActive())); } } return cache; }