org.kuali.kfs.sys.batch.dataaccess.impl
Class FiscalYearMakersDaoOjb

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport
          extended by org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
              extended by org.kuali.kfs.sys.batch.dataaccess.impl.FiscalYearMakersDaoOjb
All Implemented Interfaces:
FiscalYearMakersDao, org.kuali.rice.kns.dao.PlatformAwareDao, org.springframework.beans.factory.InitializingBean

public class FiscalYearMakersDaoOjb
extends org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
implements FiscalYearMakersDao

See Also:
org.kuali.kfs.coa.batch.dataaccess.FiscalYearMakersDao

Field Summary
protected static String KEY_STRING_DELIMITER
           
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
FiscalYearMakersDaoOjb()
           
 
Method Summary
protected  void addToKeysWritten(org.kuali.rice.kns.bo.PersistableBusinessObject copiedObject, Set<String> keysWritten)
          Builds a string from the primary key values and adds to given set
 Collection<String> createNewYearRows(Integer baseYear, FiscalYearMaker objectFiscalYearMaker, boolean replaceMode, Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<String>> parentKeysWritten, boolean isParentClass)
          Populates records for the new year and object
 void deleteNewYearRows(Integer baseYear, FiscalYearMaker objectFiscalYearMaker)
          Clears out records for the new year and object being copied
protected  String getForeignKeyStringForReference(org.kuali.rice.kns.bo.PersistableBusinessObject businessObject, String referenceName)
          Builds a String containing foreign key values for the given reference of the business object
protected  void removeNonPrimitiveFields(org.kuali.rice.kns.bo.PersistableBusinessObject businessObject)
          Sets all reference and collection fields defined in the persistence layer to null on the given object
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the businessObjectService attribute value.
 void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)
          Sets the persistenceStructureService attribute value.
protected  boolean validateChildParentReferencesExist(org.kuali.rice.kns.bo.PersistableBusinessObject childRecord, Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> parentClass, Set<String> parentKeys, Collection<String> copyErrors)
          Validates the parent record(s) exists for the child record by retrieving the OJB reference (if found and foreign keys have value)
protected  boolean validateParentRecordsExist(FiscalYearMaker objectFiscalYearMaker, org.kuali.rice.kns.bo.PersistableBusinessObject childRecord, Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<String>> parentKeysWritten, Collection<String> copyErrors)
          Checks all parents for the object we are copying has a corresponding record for the child record
protected  void writeMissingParentCopyError(org.kuali.rice.kns.bo.PersistableBusinessObject childRecord, Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> parentClass, String foreignKeyString, Collection<String> copyErrors)
          Builds an error message when a parent record was not found for the child
 
Methods inherited from class org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
getDbPlatform, setDbPlatform
 
Methods inherited from class org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport
checkDaoConfig, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, releasePersistenceBroker, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_STRING_DELIMITER

protected static final String KEY_STRING_DELIMITER
See Also:
Constant Field Values
Constructor Detail

FiscalYearMakersDaoOjb

public FiscalYearMakersDaoOjb()
Method Detail

deleteNewYearRows

public void deleteNewYearRows(Integer baseYear,
                              FiscalYearMaker objectFiscalYearMaker)
Description copied from interface: FiscalYearMakersDao
Clears out records for the new year and object being copied

Specified by:
deleteNewYearRows in interface FiscalYearMakersDao
Parameters:
baseYear - fiscal year that we are copying
objectFiscalYearMaker - FiscalYearMaker implementation for the object we are copying
See Also:
org.kuali.kfs.coa.batch.dataaccess.FiscalYearMakersDao#deleteNewYearRows(java.lang.Integer, org.kuali.kfs.coa.batch.dataaccess.FiscalYearMakerHelper)

createNewYearRows

public Collection<String> createNewYearRows(Integer baseYear,
                                            FiscalYearMaker objectFiscalYearMaker,
                                            boolean replaceMode,
                                            Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<String>> parentKeysWritten,
                                            boolean isParentClass)
Description copied from interface: FiscalYearMakersDao
Populates records for the new year and object

Specified by:
createNewYearRows in interface FiscalYearMakersDao
Parameters:
baseYear - fiscal year that we are copying
objectFiscalYearMaker - FiscalYearMaker implementation for the object we are copying
replaceMode - indicates whether records found for the new year should be replaced or left alone
parentKeysWritten - Map that contains class as key and Set of of primary key strings representing records written
isParentClass - indicates whether the class being copied is a parent to another FYM class that will be copied
Returns:
Collection of error messages encountered while attempting to copy a record
See Also:
org.kuali.kfs.sys.batch.dataaccess.FiscalYearMakersDao#createNewYearRows(java.lang.Integer, org.kuali.kfs.sys.batch.dataaccess.FiscalYearMaker, boolean, java.util.Map)

removeNonPrimitiveFields

protected void removeNonPrimitiveFields(org.kuali.rice.kns.bo.PersistableBusinessObject businessObject)
Sets all reference and collection fields defined in the persistence layer to null on the given object

Parameters:
businessObject - object to set properties for

validateParentRecordsExist

protected boolean validateParentRecordsExist(FiscalYearMaker objectFiscalYearMaker,
                                             org.kuali.rice.kns.bo.PersistableBusinessObject childRecord,
                                             Map<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>,Set<String>> parentKeysWritten,
                                             Collection<String> copyErrors)
Checks all parents for the object we are copying has a corresponding record for the child record

Returns:
true if all parent records exist, false otherwise

validateChildParentReferencesExist

protected boolean validateChildParentReferencesExist(org.kuali.rice.kns.bo.PersistableBusinessObject childRecord,
                                                     Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> parentClass,
                                                     Set<String> parentKeys,
                                                     Collection<String> copyErrors)
Validates the parent record(s) exists for the child record by retrieving the OJB reference (if found and foreign keys have value)

Parameters:
childRecord - child record we are inserting
parentClass - class for parent of child
parentKeys - Set of parent key Strings that have been written
copyErrors - Collection for adding error messages
Returns:
true if the parent record(s) exist, false otherwise

getForeignKeyStringForReference

protected String getForeignKeyStringForReference(org.kuali.rice.kns.bo.PersistableBusinessObject businessObject,
                                                 String referenceName)
Builds a String containing foreign key values for the given reference of the business object

Parameters:
businessObject - business object instance with reference
referenceName - name of reference
Returns:
String of foreign key values or null if any of the foreign key values are null

writeMissingParentCopyError

protected void writeMissingParentCopyError(org.kuali.rice.kns.bo.PersistableBusinessObject childRecord,
                                           Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> parentClass,
                                           String foreignKeyString,
                                           Collection<String> copyErrors)
Builds an error message when a parent record was not found for the child

Parameters:
childRecord - child record we are inserting
parentClass - class for parent of child
foreignKeyString - string of foreign key values that was not found in parent
copyErrors - Collection for adding error messages

addToKeysWritten

protected void addToKeysWritten(org.kuali.rice.kns.bo.PersistableBusinessObject copiedObject,
                                Set<String> keysWritten)
Builds a string from the primary key values and adds to given set

Parameters:
copiedObject - object to grab key values for
keysWritten - Set containing all pk strings

setPersistenceStructureService

public void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)
Sets the persistenceStructureService attribute value.

Parameters:
persistenceStructureService - The persistenceStructureService to set.

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value.

Parameters:
businessObjectService - The businessObjectService to set.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.