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

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.FiscalYearMakerImpl
All Implemented Interfaces:
FiscalYearMaker, org.kuali.rice.kns.dao.PlatformAwareDao, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
AccountingPeriodFiscalYearMakerImpl, EffortCertificationReportDefinitionFiscalYearMakerImpl, ObjectCodeFiscalYearMakerImpl, SystemOptionsFiscalYearMakerImpl, UniversityDateFiscalYearMakerImpl

public class FiscalYearMakerImpl
extends org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
implements FiscalYearMaker

Default implementation of fiscal year maker process for an entity. This implementation can be used for a table in the fiscal year maker process by defining a spring bean and setting the businessObjectClass property.


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
FiscalYearMakerImpl()
          Constructs a FiscalYearMakerImpl.java.
 
Method Summary
protected  void addYearCriteria(org.apache.ojb.broker.query.Criteria criteria, Integer baseFiscalYear, boolean createTwoYears)
          Adds fiscal year criteria based on the configuration (copy two years, lagging, or normal)
 void changeForNewYear(Integer baseFiscalYear, org.kuali.rice.kns.bo.PersistableBusinessObject currentRecord)
          Sets fiscal year field up one, resets version number and assigns a new Guid for the object id
 org.apache.ojb.broker.query.Criteria createDeleteCriteria(Integer baseFiscalYear)
          Selects records to delete for base year + 1 (or base year for lagging, and base year + 2 for two year)
 org.apache.ojb.broker.query.Criteria createSelectionCriteria(Integer baseFiscalYear)
          Selects records for the given base year or base year minus one if this is a lagging copy.
 boolean doCustomProcessingOnly()
          Default to doing both normal FYM process and custom
 Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> getBusinessObjectClass()
          Returns the class for the business object the fiscal year maker implementation operates on
 Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> getParentClasses()
          Options is the parent for univFiscalYear which all our copy objects should have.
 boolean isAllowOverrideTargetYear()
          Gets the allowOverrideTargetYear attribute.
 boolean isCarryForwardInactive()
          Gets the carryForwardInactive attribute.
 boolean isFiscalYearOneAhead()
          Gets the fiscalYearOneAhead attribute.
 boolean isFiscalYearOneBehind()
          Gets the fiscalYearOneBehind attribute.
 boolean isTwoYearCopy()
          Gets the twoYearCopy attribute.
 void performCustomProcessing(Integer baseFiscalYear, boolean firstCopyYear)
          Default implementation does nothing
 void setAllowOverrideTargetYear(boolean allowOverrideTargetYear)
          Sets the allowOverrideTargetYear attribute value.
 void setBusinessObjectClass(Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> businessObjectClass)
          Sets the businessObjectClass attribute value.
 void setCarryForwardInactive(boolean carryForwardInactive)
          Sets the carryForwardInactive attribute value.
 void setFiscalYearOneAhead(boolean fiscalYearOneAhead)
          Sets the fiscalYearOneAhead attribute value.
 void setFiscalYearOneBehind(boolean fiscalYearOneBehind)
          Sets the fiscalYearOneBehind attribute value.
 void setParentClasses(Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> parentClasses)
          Sets the parentClasses attribute value.
 void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)
          Sets the persistenceStructureService attribute value.
 void setTwoYearCopy(boolean twoYearCopy)
          Sets the twoYearCopy attribute value.
protected  void updateExtensionRecord(Integer newFiscalYear, org.kuali.rice.kns.bo.PersistableBusinessObject currentRecord)
          Determines if an extension record is mapped up and exists for the current record.
protected  void verifyUniversityFiscalYearPropertyExists()
          Verifies the given business object class has the university fiscal year property necessary for setting default criteria
 
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
 

Constructor Detail

FiscalYearMakerImpl

public FiscalYearMakerImpl()
Constructs a FiscalYearMakerImpl.java.

Method Detail

changeForNewYear

public void changeForNewYear(Integer baseFiscalYear,
                             org.kuali.rice.kns.bo.PersistableBusinessObject currentRecord)
Sets fiscal year field up one, resets version number and assigns a new Guid for the object id

Specified by:
changeForNewYear in interface FiscalYearMaker
Parameters:
baseFiscalYear - fiscal year of the base record
currentRecord - business object of type (@see org.kuali.kfs.coa.dataaccess.FiscalYearMakerDao.getBusinessObjectClass()) populated with the current year record data
See Also:
org.kuali.kfs.coa.dataaccess.FiscalYearMaker#changeForNewYear(java.lang.Integer, org.kuali.rice.kns.bo.PersistableBusinessObject)

updateExtensionRecord

protected void updateExtensionRecord(Integer newFiscalYear,
                                     org.kuali.rice.kns.bo.PersistableBusinessObject currentRecord)
Determines if an extension record is mapped up and exists for the current record. If so then updates the version number, object id, and clears the primary keys so they will be relinked when storing the main record

Parameters:
newFiscalYear - fiscal year to set
currentRecord - main record with possible extension reference

createSelectionCriteria

public org.apache.ojb.broker.query.Criteria createSelectionCriteria(Integer baseFiscalYear)
Selects records for the given base year or base year minus one if this is a lagging copy. If this is a two year copy base year plus one records will be selected as well. In addition will only select active records if the business object class implements the Inactivateable interface and has the active property.

Specified by:
createSelectionCriteria in interface FiscalYearMaker
Parameters:
baseFiscalYear - fiscal year of the base record
Returns:
OJB criteria object
See Also:
Inactivateable, org.kuali.kfs.coa.dataaccess.FiscalYearMaker#createSelectionCriteria(java.lang.Integer)

createDeleteCriteria

public org.apache.ojb.broker.query.Criteria createDeleteCriteria(Integer baseFiscalYear)
Selects records to delete for base year + 1 (or base year for lagging, and base year + 2 for two year)

Specified by:
createDeleteCriteria in interface FiscalYearMaker
Parameters:
baseFiscalYear - fiscal year of the base record
Returns:
OJB criteria object
See Also:
org.kuali.kfs.coa.batch.dataaccess.FiscalYearMakerHelper#createDeleteCriteria(java.lang.Integer)

addYearCriteria

protected void addYearCriteria(org.apache.ojb.broker.query.Criteria criteria,
                               Integer baseFiscalYear,
                               boolean createTwoYears)
Adds fiscal year criteria based on the configuration (copy two years, lagging, or normal)

Parameters:
criteria - OJB Criteria object
baseFiscalYear - Fiscal year for critiera
createTwoYears - indicates whether two years of fiscal year criteria should be added

verifyUniversityFiscalYearPropertyExists

protected void verifyUniversityFiscalYearPropertyExists()
Verifies the given business object class has the university fiscal year property necessary for setting default criteria

See Also:
org.kuali.kfs.sys.KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR

performCustomProcessing

public void performCustomProcessing(Integer baseFiscalYear,
                                    boolean firstCopyYear)
Default implementation does nothing

Specified by:
performCustomProcessing in interface FiscalYearMaker
Parameters:
baseFiscalYear - fiscal year of the base record
firstCopyYear - boolean that indicates whether this is the first year being copied (useful for two year copies)
See Also:
org.kuali.kfs.coa.batch.dataaccess.FiscalYearMakerHelper#performCustomProcessing(java.lang.Integer)

doCustomProcessingOnly

public boolean doCustomProcessingOnly()
Default to doing both normal FYM process and custom

Specified by:
doCustomProcessingOnly in interface FiscalYearMaker
Returns:
true if only custom processing should be done, false if both normal FYM process and custom should be performed
See Also:
org.kuali.kfs.coa.batch.dataaccess.FiscalYearMakerHelper#doCustomProcessingOnly()

getBusinessObjectClass

public Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> getBusinessObjectClass()
Description copied from interface: FiscalYearMaker
Returns the class for the business object the fiscal year maker implementation operates on

Specified by:
getBusinessObjectClass in interface FiscalYearMaker
Returns:
business object class
See Also:
org.kuali.kfs.coa.dataaccess.FiscalYearMaker#getBusinessObjectClass()

getParentClasses

public Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> getParentClasses()
Options is the parent for univFiscalYear which all our copy objects should have. Added to list here by default.

Specified by:
getParentClasses in interface FiscalYearMaker
Returns:
Set of Class objects that extend PersistableBusinessObject
See Also:
org.kuali.kfs.coa.batch.dataaccess.FiscalYearMakerHelper#getParentClasses(), org.kuali.kfs.sys.businessobject.Options

setBusinessObjectClass

public void setBusinessObjectClass(Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject> businessObjectClass)
Sets the businessObjectClass attribute value.

Parameters:
businessObjectClass - The businessObjectClass to set.

setParentClasses

public void setParentClasses(Set<Class<? extends org.kuali.rice.kns.bo.PersistableBusinessObject>> parentClasses)
Sets the parentClasses attribute value.

Parameters:
parentClasses - The parentClasses to set.

isFiscalYearOneBehind

public boolean isFiscalYearOneBehind()
Gets the fiscalYearOneBehind attribute.

Returns:
Returns the fiscalYearOneBehind.

setFiscalYearOneBehind

public void setFiscalYearOneBehind(boolean fiscalYearOneBehind)
Sets the fiscalYearOneBehind attribute value.

Parameters:
fiscalYearOneBehind - The fiscalYearOneBehind to set.

isFiscalYearOneAhead

public boolean isFiscalYearOneAhead()
Gets the fiscalYearOneAhead attribute.

Returns:
Returns the fiscalYearOneAhead.

setFiscalYearOneAhead

public void setFiscalYearOneAhead(boolean fiscalYearOneAhead)
Sets the fiscalYearOneAhead attribute value.

Parameters:
fiscalYearOneAhead - The fiscalYearOneAhead to set.

isTwoYearCopy

public boolean isTwoYearCopy()
Gets the twoYearCopy attribute.

Specified by:
isTwoYearCopy in interface FiscalYearMaker
Returns:
Returns the twoYearCopy.

setTwoYearCopy

public void setTwoYearCopy(boolean twoYearCopy)
Sets the twoYearCopy attribute value.

Parameters:
twoYearCopy - The twoYearCopy to set.

isCarryForwardInactive

public boolean isCarryForwardInactive()
Gets the carryForwardInactive attribute.

Returns:
Returns the carryForwardInactive.

setCarryForwardInactive

public void setCarryForwardInactive(boolean carryForwardInactive)
Sets the carryForwardInactive attribute value.

Parameters:
carryForwardInactive - The carryForwardInactive to set.

setPersistenceStructureService

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

Parameters:
persistenceStructureService - The persistenceStructureService to set.

isAllowOverrideTargetYear

public boolean isAllowOverrideTargetYear()
Gets the allowOverrideTargetYear attribute.

Specified by:
isAllowOverrideTargetYear in interface FiscalYearMaker
Returns:
Returns the allowOverrideTargetYear.

setAllowOverrideTargetYear

public void setAllowOverrideTargetYear(boolean allowOverrideTargetYear)
Sets the allowOverrideTargetYear attribute value.

Parameters:
allowOverrideTargetYear - The allowOverrideTargetYear to set.


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