001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.kuali.kfs.coa.businessobject;
018    
019    import java.util.ArrayList;
020    import java.util.HashMap;
021    import java.util.LinkedHashMap;
022    import java.util.List;
023    import java.util.Map;
024    
025    import org.kuali.kfs.coa.service.ChartService;
026    import org.kuali.kfs.sys.KFSPropertyConstants;
027    import org.kuali.kfs.sys.businessobject.SystemOptions;
028    import org.kuali.kfs.sys.context.SpringContext;
029    import org.kuali.rice.kns.bo.DocumentHeader;
030    import org.kuali.rice.kns.bo.GlobalBusinessObject;
031    import org.kuali.rice.kns.bo.GlobalBusinessObjectDetail;
032    import org.kuali.rice.kns.bo.PersistableBusinessObject;
033    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
034    import org.kuali.rice.kns.service.BusinessObjectService;
035    import org.kuali.rice.kns.util.TypedArrayList;
036    
037    /**
038     * 
039     */
040    public class ObjectCodeGlobal extends PersistableBusinessObjectBase implements GlobalBusinessObject {
041    
042        private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ObjectCodeGlobal.class);
043    
044        private String documentNumber;
045        private Integer universityFiscalYear;
046        private String chartOfAccountsCode;
047        private String financialObjectCode;
048        private String financialObjectCodeName;
049        private String financialObjectCodeShortName;
050        private String financialObjectLevelCode;
051        private String reportsToChartOfAccountsCode;
052        private String reportsToFinancialObjectCode;
053        private String financialObjectTypeCode;
054        private String financialObjectSubTypeCode;
055        private String historicalFinancialObjectCode;
056        private boolean financialObjectActiveIndicator;
057        private String financialBudgetAggregationCd;
058        private String finObjMandatoryTrnfrOrElimCd;
059        private String financialFederalFundedCode;
060        private String nextYearFinancialObjectCode;
061    
062        private DocumentHeader financialDocument;
063        private ObjectCode financialObject;
064        private ObjectCode reportsToFinancialObject;
065        private SystemOptions universityFiscal;
066        private Chart chartOfAccounts;
067        private Chart reportsToChartOfAccounts;
068        private ObjectType financialObjectType;
069        private ObjectSubType financialObjectSubType;
070        private ObjectLevel financialObjectLevel;
071        private BudgetAggregationCode financialBudgetAggregation;
072        private MandatoryTransferEliminationCode finObjMandatoryTrnfrelim;
073        private FederalFundedCode financialFederalFunded;
074    
075        private List<ObjectCodeGlobalDetail> objectCodeGlobalDetails;
076    
077        /**
078         * Default constructor.
079         */
080        public ObjectCodeGlobal() {
081    
082    
083            objectCodeGlobalDetails = new TypedArrayList(ObjectCodeGlobalDetail.class);
084    
085        }
086    
087        /**
088         * Gets the documentNumber attribute.
089         * 
090         * @return Returns the documentNumber
091         */
092        public String getDocumentNumber() {
093            return documentNumber;
094        }
095    
096        /**
097         * Sets the documentNumber attribute.
098         * 
099         * @param documentNumber The documentNumber to set.
100         */
101        public void setDocumentNumber(String documentNumber) {
102            this.documentNumber = documentNumber;
103        }
104    
105    
106        /**
107         * Gets the universityFiscalYear attribute.
108         * 
109         * @return Returns the universityFiscalYear
110         */
111        public Integer getUniversityFiscalYear() {
112            return universityFiscalYear;
113        }
114    
115        /**
116         * Sets the universityFiscalYear attribute.
117         * 
118         * @param universityFiscalYear The universityFiscalYear to set.
119         */
120        public void setUniversityFiscalYear(Integer universityFiscalYear) {
121            this.universityFiscalYear = universityFiscalYear;
122        }
123    
124    
125        /**
126         * Gets the chartOfAccountsCode attribute.
127         * 
128         * @return Returns the chartOfAccountsCode
129         */
130        public String getChartOfAccountsCode() {
131            return chartOfAccountsCode;
132        }
133    
134        /**
135         * Sets the chartOfAccountsCode attribute.
136         * 
137         * @param chartOfAccountsCode The chartOfAccountsCode to set.
138         */
139        public void setChartOfAccountsCode(String chartOfAccountsCode) {
140            this.chartOfAccountsCode = chartOfAccountsCode;
141        }
142    
143    
144        /**
145         * Gets the financialObjectCode attribute.
146         * 
147         * @return Returns the financialObjectCode
148         */
149        public String getFinancialObjectCode() {
150            return financialObjectCode;
151        }
152    
153        /**
154         * Sets the financialObjectCode attribute.
155         * 
156         * @param financialObjectCode The financialObjectCode to set.
157         */
158        public void setFinancialObjectCode(String financialObjectCode) {
159            this.financialObjectCode = financialObjectCode;
160        }
161    
162    
163        /**
164         * Gets the financialObjectCodeName attribute.
165         * 
166         * @return Returns the financialObjectCodeName
167         */
168        public String getFinancialObjectCodeName() {
169            return financialObjectCodeName;
170        }
171    
172        /**
173         * Sets the financialObjectCodeName attribute.
174         * 
175         * @param financialObjectCodeName The financialObjectCodeName to set.
176         */
177        public void setFinancialObjectCodeName(String financialObjectCodeName) {
178            this.financialObjectCodeName = financialObjectCodeName;
179        }
180    
181    
182        /**
183         * Gets the financialObjectCodeShortName attribute.
184         * 
185         * @return Returns the financialObjectCodeShortName
186         */
187        public String getFinancialObjectCodeShortName() {
188            return financialObjectCodeShortName;
189        }
190    
191        /**
192         * Sets the financialObjectCodeShortName attribute.
193         * 
194         * @param financialObjectCodeShortName The financialObjectCodeShortName to set.
195         */
196        public void setFinancialObjectCodeShortName(String financialObjectCodeShortName) {
197            this.financialObjectCodeShortName = financialObjectCodeShortName;
198        }
199    
200    
201        /**
202         * Gets the financialObjectLevelCode attribute.
203         * 
204         * @return Returns the financialObjectLevelCode
205         */
206        public String getFinancialObjectLevelCode() {
207            return financialObjectLevelCode;
208        }
209    
210        /**
211         * Sets the financialObjectLevelCode attribute.
212         * 
213         * @param financialObjectLevelCode The financialObjectLevelCode to set.
214         */
215        public void setFinancialObjectLevelCode(String financialObjectLevelCode) {
216            this.financialObjectLevelCode = financialObjectLevelCode;
217        }
218    
219    
220        /**
221         * Gets the reportsToChartOfAccountsCode attribute.
222         * 
223         * @return Returns the reportsToChartOfAccountsCode
224         */
225        public String getReportsToChartOfAccountsCode() {
226            return reportsToChartOfAccountsCode;
227        }
228    
229        /**
230         * Sets the reportsToChartOfAccountsCode attribute.
231         * 
232         * @param reportsToChartOfAccountsCode The reportsToChartOfAccountsCode to set.
233         */
234        public void setReportsToChartOfAccountsCode(String reportsToChartOfAccountsCode) {
235            this.reportsToChartOfAccountsCode = reportsToChartOfAccountsCode;
236        }
237    
238    
239        /**
240         * Gets the reportsToFinancialObjectCode attribute.
241         * 
242         * @return Returns the reportsToFinancialObjectCode
243         */
244        public String getReportsToFinancialObjectCode() {
245            return reportsToFinancialObjectCode;
246        }
247    
248        /**
249         * Sets the reportsToFinancialObjectCode attribute.
250         * 
251         * @param reportsToFinancialObjectCode The reportsToFinancialObjectCode to set.
252         */
253        public void setReportsToFinancialObjectCode(String reportsToFinancialObjectCode) {
254            this.reportsToFinancialObjectCode = reportsToFinancialObjectCode;
255        }
256    
257    
258        /**
259         * Gets the financialObjectTypeCode attribute.
260         * 
261         * @return Returns the financialObjectTypeCode
262         */
263        public String getFinancialObjectTypeCode() {
264            return financialObjectTypeCode;
265        }
266    
267        /**
268         * Sets the financialObjectTypeCode attribute.
269         * 
270         * @param financialObjectTypeCode The financialObjectTypeCode to set.
271         */
272        public void setFinancialObjectTypeCode(String financialObjectTypeCode) {
273            this.financialObjectTypeCode = financialObjectTypeCode;
274        }
275    
276    
277        /**
278         * Gets the financialObjectSubTypeCode attribute.
279         * 
280         * @return Returns the financialObjectSubTypeCode
281         */
282        public String getFinancialObjectSubTypeCode() {
283            return financialObjectSubTypeCode;
284        }
285    
286        /**
287         * Sets the financialObjectSubTypeCode attribute.
288         * 
289         * @param financialObjectSubTypeCode The financialObjectSubTypeCode to set.
290         */
291        public void setFinancialObjectSubTypeCode(String financialObjectSubTypeCode) {
292            this.financialObjectSubTypeCode = financialObjectSubTypeCode;
293        }
294    
295    
296        /**
297         * Gets the historicalFinancialObjectCode attribute.
298         * 
299         * @return Returns the historicalFinancialObjectCode
300         */
301        public String getHistoricalFinancialObjectCode() {
302            return historicalFinancialObjectCode;
303        }
304    
305        /**
306         * Sets the historicalFinancialObjectCode attribute.
307         * 
308         * @param historicalFinancialObjectCode The historicalFinancialObjectCode to set.
309         */
310        public void setHistoricalFinancialObjectCode(String historicalFinancialObjectCode) {
311            this.historicalFinancialObjectCode = historicalFinancialObjectCode;
312        }
313    
314    
315        /**
316         * Gets the financialObjectActiveIndicator attribute.
317         * 
318         * @return Returns the financialObjectActiveIndicator
319         */
320        public boolean isFinancialObjectActiveIndicator() {
321            return financialObjectActiveIndicator;
322        }
323    
324    
325        /**
326         * Sets the financialObjectActiveIndicator attribute.
327         * 
328         * @param financialObjectActiveIndicator The financialObjectActiveIndicator to set.
329         */
330        public void setFinancialObjectActiveIndicator(boolean financialObjectActiveIndicator) {
331            this.financialObjectActiveIndicator = financialObjectActiveIndicator;
332        }
333    
334    
335        /**
336         * Gets the financialBudgetAggregationCd attribute.
337         * 
338         * @return Returns the financialBudgetAggregationCd
339         */
340        public String getFinancialBudgetAggregationCd() {
341            return financialBudgetAggregationCd;
342        }
343    
344        /**
345         * Sets the financialBudgetAggregationCd attribute.
346         * 
347         * @param financialBudgetAggregationCd The financialBudgetAggregationCd to set.
348         */
349        public void setFinancialBudgetAggregationCd(String financialBudgetAggregationCd) {
350            this.financialBudgetAggregationCd = financialBudgetAggregationCd;
351        }
352    
353    
354        /**
355         * Gets the finObjMandatoryTrnfrOrElimCd attribute.
356         * 
357         * @return Returns the finObjMandatoryTrnfrOrElimCd
358         */
359        public String getFinObjMandatoryTrnfrOrElimCd() {
360            return finObjMandatoryTrnfrOrElimCd;
361        }
362    
363        /**
364         * Sets the finObjMandatoryTrnfrOrElimCd attribute.
365         * 
366         * @param finObjMandatoryTrnfrOrElimCd The finObjMandatoryTrnfrOrElimCd to set.
367         */
368        public void setFinObjMandatoryTrnfrOrElimCd(String finObjMandatoryTrnfrOrElimCd) {
369            this.finObjMandatoryTrnfrOrElimCd = finObjMandatoryTrnfrOrElimCd;
370        }
371    
372    
373        /**
374         * Gets the financialFederalFundedCode attribute.
375         * 
376         * @return Returns the financialFederalFundedCode
377         */
378        public String getFinancialFederalFundedCode() {
379            return financialFederalFundedCode;
380        }
381    
382        /**
383         * Sets the financialFederalFundedCode attribute.
384         * 
385         * @param financialFederalFundedCode The financialFederalFundedCode to set.
386         */
387        public void setFinancialFederalFundedCode(String financialFederalFundedCode) {
388            this.financialFederalFundedCode = financialFederalFundedCode;
389        }
390    
391    
392        /**
393         * Gets the nextYearFinancialObjectCode attribute.
394         * 
395         * @return Returns the nextYearFinancialObjectCode
396         */
397        public String getNextYearFinancialObjectCode() {
398            return nextYearFinancialObjectCode;
399        }
400    
401        /**
402         * Sets the nextYearFinancialObjectCode attribute.
403         * 
404         * @param nextYearFinancialObjectCode The nextYearFinancialObjectCode to set.
405         */
406        public void setNextYearFinancialObjectCode(String nextYearFinancialObjectCode) {
407            this.nextYearFinancialObjectCode = nextYearFinancialObjectCode;
408        }
409    
410    
411        /**
412         * Gets the financialDocument attribute.
413         * 
414         * @return Returns the financialDocument
415         */
416        public DocumentHeader getFinancialDocument() {
417            return financialDocument;
418        }
419    
420        /**
421         * Sets the financialDocument attribute.
422         * 
423         * @param financialDocument The financialDocument to set.
424         * @deprecated
425         */
426        public void setFinancialDocument(DocumentHeader financialDocument) {
427            this.financialDocument = financialDocument;
428        }
429    
430        /**
431         * Gets the financialObject attribute.
432         * 
433         * @return Returns the financialObject
434         */
435        public ObjectCode getFinancialObject() {
436            return financialObject;
437        }
438    
439        /**
440         * Sets the financialObject attribute.
441         * 
442         * @param financialObject The financialObject to set.
443         * @deprecated
444         */
445        public void setFinancialObject(ObjectCode financialObject) {
446            this.financialObject = financialObject;
447        }
448    
449        /**
450         * Gets the reportsToFinancialObject attribute.
451         * 
452         * @return Returns the reportsToFinancialObject
453         */
454        public ObjectCode getReportsToFinancialObject() {
455            return reportsToFinancialObject;
456        }
457    
458        /**
459         * Sets the reportsToFinancialObject attribute.
460         * 
461         * @param reportsToFinancialObject The reportsToFinancialObject to set.
462         * @deprecated
463         */
464        public void setReportsToFinancialObject(ObjectCode reportsToFinancialObject) {
465            this.reportsToFinancialObject = reportsToFinancialObject;
466        }
467    
468        /**
469         * Gets the universityFiscal attribute.
470         * 
471         * @return Returns the universityFiscal
472         */
473        public SystemOptions getUniversityFiscal() {
474            return universityFiscal;
475        }
476    
477        /**
478         * Sets the universityFiscal attribute.
479         * 
480         * @param universityFiscal The universityFiscal to set.
481         * @deprecated
482         */
483        public void setUniversityFiscal(SystemOptions universityFiscal) {
484            this.universityFiscal = universityFiscal;
485        }
486    
487        /**
488         * Gets the chartOfAccounts attribute.
489         * 
490         * @return Returns the chartOfAccounts
491         */
492        public Chart getChartOfAccounts() {
493            return chartOfAccounts;
494        }
495    
496        /**
497         * Sets the chartOfAccounts attribute.
498         * 
499         * @param chartOfAccounts The chartOfAccounts to set.
500         * @deprecated
501         */
502        public void setChartOfAccounts(Chart chartOfAccounts) {
503            this.chartOfAccounts = chartOfAccounts;
504        }
505    
506        /**
507         * Gets the reportsToChartOfAccounts attribute.
508         * 
509         * @return Returns the reportsToChartOfAccounts
510         */
511        public Chart getReportsToChartOfAccounts() {
512            return reportsToChartOfAccounts;
513        }
514    
515        /**
516         * Sets the reportsToChartOfAccounts attribute.
517         * 
518         * @param reportsToChartOfAccounts The reportsToChartOfAccounts to set.
519         * @deprecated
520         */
521        public void setReportsToChartOfAccounts(Chart reportsToChartOfAccounts) {
522            this.reportsToChartOfAccounts = reportsToChartOfAccounts;
523        }
524    
525        /**
526         * This method returns the FinancialObjectSubType attribute.
527         * 
528         * @return Returns FinancialObjectSubType attribute.
529         */
530        public ObjectSubType getFinancialObjectSubType() {
531            return financialObjectSubType;
532        }
533    
534        /**
535         * This method sets the FinancialObjectSubType attribute.
536         * 
537         * @param financialObjectSubType The financialObjectSubType to set.
538         * @deprecated
539         */
540        public void setFinancialObjectSubType(ObjectSubType financialObjectSubType) {
541            this.financialObjectSubType = financialObjectSubType;
542        }
543    
544        /**
545         * This method returns the FinancialObjectType
546         * 
547         * @return an ObjectType for this ObjectCodeGlobal.
548         */
549        public ObjectType getFinancialObjectType() {
550            return financialObjectType;
551        }
552    
553        /**
554         * This method sets a FinancialObjectType
555         * 
556         * @param financialObjectType the ObjectType to set.
557         * @deprecated
558         */
559        public void setFinancialObjectType(ObjectType financialObjectType) {
560            this.financialObjectType = financialObjectType;
561        }
562    
563        /**
564         * This method returns the FinancialBudgetAggregation
565         * 
566         * @return the FinancialBudgetAggregation
567         */
568        public BudgetAggregationCode getFinancialBudgetAggregation() {
569            return financialBudgetAggregation;
570        }
571    
572        /**
573         * This method sets a FinancialBudgetAggregation
574         * 
575         * @param financialBudgetAggregation the BudgetAggregationCode to set
576         * @deprecated
577         */
578        public void setFinancialBudgetAggregation(BudgetAggregationCode financialBudgetAggregation) {
579            this.financialBudgetAggregation = financialBudgetAggregation;
580        }
581    
582        /**
583         * This method the financial federal funded code for this ObjectCodeGlobal
584         * 
585         * @return the Federal Funded Code
586         */
587        public FederalFundedCode getFinancialFederalFunded() {
588            return financialFederalFunded;
589        }
590    
591        /**
592         * This method sets FinancialFederalFunded
593         * 
594         * @param financialFederalFunded the FederalFundedCode to set
595         * @deprecated
596         */
597        public void setFinancialFederalFunded(FederalFundedCode financialFederalFunded) {
598            this.financialFederalFunded = financialFederalFunded;
599        }
600    
601        /**
602         * This method returns the Object Level
603         * 
604         * @return ObjectLevel
605         */
606        public ObjectLevel getFinancialObjectLevel() {
607            return financialObjectLevel;
608        }
609    
610        /**
611         * This method sets the FinancialObjectLevel
612         * 
613         * @param financialObjectLevel the ObjLevel to set
614         * @deprecated
615         */
616        public void setFinancialObjectLevel(ObjectLevel financialObjectLevel) {
617            this.financialObjectLevel = financialObjectLevel;
618        }
619    
620        /**
621         * This method returns the Mandatory Transfer or Elimination Code
622         * 
623         * @return the MandatoryTransferEliminationCode
624         */
625        public MandatoryTransferEliminationCode getFinObjMandatoryTrnfrelim() {
626            return finObjMandatoryTrnfrelim;
627        }
628    
629        /**
630         * This method pretty much sets the FinObjMandatoryTrnfrelm (the Mandatory Transfer or Elimination Code)
631         * 
632         * @param finObjMandatoryTrnfrelim the MandatoryTransferEliminationCode to set
633         * @deprecated
634         */
635        public void setFinObjMandatoryTrnfrelim(MandatoryTransferEliminationCode finObjMandatoryTrnfrelim) {
636            this.finObjMandatoryTrnfrelim = finObjMandatoryTrnfrelim;
637        }
638    
639        /**
640         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
641         */
642        protected LinkedHashMap<String,String> toStringMapper() {
643            LinkedHashMap<String,String> m = new LinkedHashMap<String,String>();
644            m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
645            return m;
646        }
647    
648        public List<ObjectCodeGlobalDetail> getObjectCodeGlobalDetails() {
649            return objectCodeGlobalDetails;
650        }
651    
652        public void setObjectCodeGlobalDetails(List<ObjectCodeGlobalDetail> objectCodeGlobalDetails) {
653            this.objectCodeGlobalDetails = objectCodeGlobalDetails;
654        }
655    
656        /**
657         * @see org.kuali.rice.kns.document.GlobalBusinessObject#getGlobalChangesToDelete()
658         */
659        public List<PersistableBusinessObject> generateDeactivationsToPersist() {
660            return null;
661        }
662    
663        /**
664         * This returns a list of Object Codes to Update and/or Add
665         * 
666         * @see org.kuali.rice.kns.document.GlobalBusinessObject#applyGlobalChanges()
667         */
668        public List<PersistableBusinessObject> generateGlobalChangesToPersist() {
669            LOG.debug("applyGlobalChanges");
670            List result = new ArrayList();
671    
672            // Iterate through Object Codes; create new or update as necessary
673            // Set reports-to Chart to appropriate value
674    
675            for (ObjectCodeGlobalDetail detail : objectCodeGlobalDetails) {
676    
677                Map pk = new HashMap();
678    
679                Integer fiscalYear = detail.getUniversityFiscalYear();
680                String chart = detail.getChartOfAccountsCode();
681    
682                if (fiscalYear != null && chart != null && chart.length() > 0) {
683                    pk.put("UNIV_FISCAL_YR", fiscalYear);
684                    pk.put("FIN_COA_CD", chart);
685                    pk.put("FIN_OBJECT_CD", financialObjectCode);
686    
687                    ObjectCode objectCode = (ObjectCode) SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(ObjectCode.class, pk);
688                    if (objectCode == null) {
689                        objectCode = new ObjectCode(fiscalYear, chart, financialObjectCode);
690                        objectCode.setFinancialObjectActiveCode(true);
691                    }
692                    populate(objectCode, detail);
693                    Map<String, String> hierarchy = SpringContext.getBean(ChartService.class).getReportsToHierarchy();
694                    objectCode.setReportsToChartOfAccountsCode(hierarchy.get(chart));
695    
696                    result.add(objectCode);
697                }
698            }
699    
700            return result;
701        }
702    
703        public void populate(ObjectCode old, ObjectCodeGlobalDetail detail) {
704    
705            old.setFinancialObjectCodeName(update(financialObjectCodeName, old.getFinancialObjectCodeName()));
706            old.setFinancialObjectCodeShortName(update(financialObjectCodeShortName, old.getFinancialObjectCodeShortName()));
707    
708            old.setFinancialObjectLevelCode(update(financialObjectLevelCode, old.getFinancialObjectLevelCode()));
709            old.setFinancialObjectTypeCode(update(financialObjectTypeCode, old.getFinancialObjectTypeCode()));
710            old.setFinancialObjectSubTypeCode(update(financialObjectSubTypeCode, old.getFinancialObjectSubTypeCode()));
711            old.setHistoricalFinancialObjectCode(update(historicalFinancialObjectCode, old.getHistoricalFinancialObjectCode()));
712            old.setFinancialObjectActiveCode(update(financialObjectActiveIndicator, old.isFinancialObjectActiveCode()));
713            old.setFinancialBudgetAggregationCd(update(financialBudgetAggregationCd, old.getFinancialBudgetAggregationCd()));
714            old.setFinObjMandatoryTrnfrelimCd(update(finObjMandatoryTrnfrOrElimCd, old.getFinObjMandatoryTrnfrelimCd()));
715            old.setFinancialFederalFundedCode(update(financialFederalFundedCode, old.getFinancialFederalFundedCode()));
716            old.setNextYearFinancialObjectCode(update(nextYearFinancialObjectCode, old.getNextYearFinancialObjectCode()));
717            old.setReportsToFinancialObjectCode(update(reportsToFinancialObjectCode, old.getReportsToFinancialObjectCode()));
718        }
719    
720    
721        /**
722         * This method returns newvalue iff it is not empty
723         * 
724         * @param oldValue
725         * @param newValue
726         * @return
727         */
728        private String update(String newValue, String oldValue) {
729            if (newValue == null || newValue.length() == 0) {
730                return oldValue;
731            }
732            return newValue;
733        }
734    
735        private boolean update(boolean newValue, boolean oldValue) {
736            return newValue;
737        }
738    
739    
740        public boolean isPersistable() {
741            return true;
742        }
743    
744        public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() {
745            return getObjectCodeGlobalDetails();
746        }
747    
748        /**
749         * @see org.kuali.rice.kns.bo.PersistableBusinessObjectBase#buildListOfDeletionAwareLists()
750         */
751        @Override
752        public List buildListOfDeletionAwareLists() {
753            List<List> managedLists = super.buildListOfDeletionAwareLists();
754    
755            managedLists.add(getObjectCodeGlobalDetails());
756    
757            return managedLists;
758        }
759    }