org.kuali.kfs.coa.dataaccess.impl
Class AccountDaoOjb

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.coa.dataaccess.impl.AccountDaoOjb
All Implemented Interfaces:
AccountDao, org.kuali.rice.kns.dao.PlatformAwareDao, org.springframework.beans.factory.InitializingBean

public class AccountDaoOjb
extends org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
implements AccountDao

This class is the OJB implementation of the AccountDao interface.


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
AccountDaoOjb()
           
 
Method Summary
 boolean determineUserResponsibilityOnAccount(org.kuali.rice.kim.bo.Person person, Account account)
          This method determines if the given user has any responsibilities on the given account
protected  org.apache.ojb.broker.query.Criteria getAccountExpiredCriteria()
          Builds a criteria to find expired accounts
protected  org.apache.ojb.broker.query.Criteria getAccountNotExpiredCriteria()
          Builds a criteria to find non-expired accounts
 Collection<Account> getAccountsForAccountNumber(String accountNumber)
           
 List getAccountsThatUserIsResponsibleFor(org.kuali.rice.kim.bo.Person person)
          fetch the accounts that the user is either the fiscal officer or a delegate of the fiscal officer
 Iterator<Account> getActiveAccountsForAccountSupervisor(String principalId)
          Retrieves all active accounts from the database where the given principal is the account supervisor
 Iterator<Account> getActiveAccountsForFiscalOfficer(String principalId)
          Retrieves all active accounts from the database where the given principal is the fiscal officer
 Iterator getAllAccounts()
          get all accounts in the system.
 Account getByPrimaryId(String chartOfAccountsCode, String accountNumber)
          Retrieves account business object by primary key
protected  org.apache.ojb.broker.query.Criteria getDelegateByExampleCriteria(AccountDelegate delegateExample, String totalDollarAmount, String accountsDelegatePrmrtIndicator)
          This method creates a Criteria based on Delegate, dollar amount and whether or not it is the primary delegate
protected  List getDelegatedResponsibilities(org.kuali.rice.kim.bo.Person person)
          method to get the fo delegated responsibilities for the account
 Iterator<Account> getExpiredAccountsForAccountSupervisor(String principalId)
          Retrieves all active accounts from the database where the given principal is the account supervisor
 Iterator<Account> getExpiredAccountsForFiscalOfficer(String principalId)
          Retrieves all expired accounts from the database where the given principal is the fiscal officer
protected  List getFiscalOfficerResponsibilities(org.kuali.rice.kim.bo.Person person)
          method to get the fo responsibilities for the account
 List getPrimaryDelegationByExample(AccountDelegate delegateExample, String totalDollarAmount)
          Resolves the Primary Delegate for the given delegate example.
 List getSecondaryDelegationsByExample(AccountDelegate delegateExample, String totalDollarAmount)
           
protected  boolean hasDelegatedResponsibility(org.kuali.rice.kim.bo.Person person, Account account)
          This method determines if a user has delegated responsibilities on a given account.
protected  boolean hasFiscalOfficerResponsibility(org.kuali.rice.kim.bo.Person person, Account account)
          This method determines if a given user has fiscal officer responsiblity on a given account.
 boolean isPrincipalInAnyWayShapeOrFormAccountManager(String principalId)
          Determines if the given principal is the account manager of any non-closed account
 boolean isPrincipalInAnyWayShapeOrFormAccountSupervisor(String principalId)
          Determines if the given principal is the account supervisor of any non-closed account
 boolean isPrincipalInAnyWayShapeOrFormFiscalOfficer(String principalId)
          Determines if the given principal is the fiscal officer of any non-closed account
protected  boolean queryPrincipalHasAccountRole(String principalId, String principalRoleName)
          Determines if any non-closed accounts exist where the principal id is in the role of the role name
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
           
 
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

AccountDaoOjb

public AccountDaoOjb()
Method Detail

getByPrimaryId

public Account getByPrimaryId(String chartOfAccountsCode,
                              String accountNumber)
Retrieves account business object by primary key

Specified by:
getByPrimaryId in interface AccountDao
Parameters:
chartOfAccountsCode - - the FIN_COA_CD of the Chart Code that is part of the composite key of Account
accountNumber - - the ACCOUNT_NBR part of the composite key of Accont
Returns:
Account
See Also:
AccountDao

getAccountsThatUserIsResponsibleFor

public List getAccountsThatUserIsResponsibleFor(org.kuali.rice.kim.bo.Person person)
fetch the accounts that the user is either the fiscal officer or a delegate of the fiscal officer

Specified by:
getAccountsThatUserIsResponsibleFor in interface AccountDao
Parameters:
kualiUser -
Returns:
a list of Accounts that the user has responsibility for

determineUserResponsibilityOnAccount

public boolean determineUserResponsibilityOnAccount(org.kuali.rice.kim.bo.Person person,
                                                    Account account)
This method determines if the given user has any responsibilities on the given account

Specified by:
determineUserResponsibilityOnAccount in interface AccountDao
Parameters:
person - the user to check responsibilities for
account - the account to check responsibilities on
Returns:
true if user is somehow responsible for account, false if otherwise

getPrimaryDelegationByExample

public List getPrimaryDelegationByExample(AccountDelegate delegateExample,
                                          String totalDollarAmount)
Resolves the Primary Delegate for the given delegate example. If the primary delegate exists for a specific Document Type Code and for a Document Type Code of "KFS", the delegate for the specific document type code is returned;

Specified by:
getPrimaryDelegationByExample in interface AccountDao
See Also:
AccountDao.getPrimaryDelegationByExample(org.kuali.kfs.coa.businessobject.AccountDelegate, java.lang.String)

getSecondaryDelegationsByExample

public List getSecondaryDelegationsByExample(AccountDelegate delegateExample,
                                             String totalDollarAmount)
Specified by:
getSecondaryDelegationsByExample in interface AccountDao
See Also:
AccountDao.getSecondaryDelegationsByExample(org.kuali.kfs.coa.businessobject.AccountDelegate, java.lang.String)

getDelegateByExampleCriteria

protected org.apache.ojb.broker.query.Criteria getDelegateByExampleCriteria(AccountDelegate delegateExample,
                                                                            String totalDollarAmount,
                                                                            String accountsDelegatePrmrtIndicator)
This method creates a Criteria based on Delegate, dollar amount and whether or not it is the primary delegate

Parameters:
delegateExample -
totalDollarAmount -
accountsDelegatePrmrtIndicator -
Returns:
example Delegate Criteria

getFiscalOfficerResponsibilities

protected List getFiscalOfficerResponsibilities(org.kuali.rice.kim.bo.Person person)
method to get the fo responsibilities for the account

Parameters:
person - - fiscal officer to check for
Returns:
list of AccountResponsibility for this fiscal officer

hasFiscalOfficerResponsibility

protected boolean hasFiscalOfficerResponsibility(org.kuali.rice.kim.bo.Person person,
                                                 Account account)
This method determines if a given user has fiscal officer responsiblity on a given account.

Parameters:
person - the user to check responsibilities for
account - the account to check responsibilities on
Returns:
true if user does have fiscal officer responsibility on account, false if otherwise

getDelegatedResponsibilities

protected List getDelegatedResponsibilities(org.kuali.rice.kim.bo.Person person)
method to get the fo delegated responsibilities for the account

Parameters:
person - - user to check against
Returns:
a list of AccountResponsibility objects for a delegate

hasDelegatedResponsibility

protected boolean hasDelegatedResponsibility(org.kuali.rice.kim.bo.Person person,
                                             Account account)
This method determines if a user has delegated responsibilities on a given account.

Parameters:
person - the user to check responsibilities for
account - the account to check responsibilities on
Returns:
true if user has delegated responsibilities

getAllAccounts

public Iterator getAllAccounts()
Description copied from interface: AccountDao
get all accounts in the system. This is needed by a sufficient funds rebuilder job

Specified by:
getAllAccounts in interface AccountDao
Returns:
an iterator for all accounts
See Also:
AccountDao.getAllAccounts()

getActiveAccountsForAccountSupervisor

public Iterator<Account> getActiveAccountsForAccountSupervisor(String principalId)
Description copied from interface: AccountDao
Retrieves all active accounts from the database where the given principal is the account supervisor

Specified by:
getActiveAccountsForAccountSupervisor in interface AccountDao
Parameters:
principalId - the principal id of the account supervisor
Returns:
an Iterator of active Accounts
See Also:
AccountDao.getActiveAccountsForAccountSupervisor(java.lang.String)

getActiveAccountsForFiscalOfficer

public Iterator<Account> getActiveAccountsForFiscalOfficer(String principalId)
Description copied from interface: AccountDao
Retrieves all active accounts from the database where the given principal is the fiscal officer

Specified by:
getActiveAccountsForFiscalOfficer in interface AccountDao
Parameters:
principalId - the principal id of the fiscal officer
Returns:
an Iterator of active Accounts
See Also:
AccountDao.getActiveAccountsForFiscalOfficer(java.lang.String)

getExpiredAccountsForAccountSupervisor

public Iterator<Account> getExpiredAccountsForAccountSupervisor(String principalId)
Description copied from interface: AccountDao
Retrieves all active accounts from the database where the given principal is the account supervisor

Specified by:
getExpiredAccountsForAccountSupervisor in interface AccountDao
Parameters:
principalId - the principal id of the account supervisor
Returns:
an Iterator of expired Accounts
See Also:
AccountDao.getExpiredAccountsForAccountSupervisor(java.lang.String)

getExpiredAccountsForFiscalOfficer

public Iterator<Account> getExpiredAccountsForFiscalOfficer(String principalId)
Description copied from interface: AccountDao
Retrieves all expired accounts from the database where the given principal is the fiscal officer

Specified by:
getExpiredAccountsForFiscalOfficer in interface AccountDao
Parameters:
principalId - the principal id of the fiscal officer
Returns:
an Iterator of expired Accounts
See Also:
AccountDao.getExpiredAccountsForFiscalOfficer(java.lang.String)

getAccountExpiredCriteria

protected org.apache.ojb.broker.query.Criteria getAccountExpiredCriteria()
Builds a criteria to find expired accounts

Returns:
a Criteria for expired accounts

getAccountNotExpiredCriteria

protected org.apache.ojb.broker.query.Criteria getAccountNotExpiredCriteria()
Builds a criteria to find non-expired accounts

Returns:
a Criteria for non-expired accounts

isPrincipalInAnyWayShapeOrFormAccountManager

public boolean isPrincipalInAnyWayShapeOrFormAccountManager(String principalId)
Description copied from interface: AccountDao
Determines if the given principal is the account manager of any non-closed account

Specified by:
isPrincipalInAnyWayShapeOrFormAccountManager in interface AccountDao
Parameters:
principalId - the principal to check for the account manager role
Returns:
true if the principal is a account manager for any non-closed account, false otherwise
See Also:
AccountDao.isPrincipalInAnyWayShapeOrFormAccountManager(java.lang.String)

queryPrincipalHasAccountRole

protected boolean queryPrincipalHasAccountRole(String principalId,
                                               String principalRoleName)
Determines if any non-closed accounts exist where the principal id is in the role of the role name

Parameters:
principalId - the principal id to check
principalRoleName - the name of the field on account to check for the principal id in
Returns:
true if the principal has that account role, false otherwise

isPrincipalInAnyWayShapeOrFormAccountSupervisor

public boolean isPrincipalInAnyWayShapeOrFormAccountSupervisor(String principalId)
Description copied from interface: AccountDao
Determines if the given principal is the account supervisor of any non-closed account

Specified by:
isPrincipalInAnyWayShapeOrFormAccountSupervisor in interface AccountDao
Parameters:
principalId - the principal to check for the account supervisor role
Returns:
true if the principal is a account supervisor for any non-closed account, false otherwise
See Also:
AccountDao.isPrincipalInAnyWayShapeOrFormAccountSupervisor(java.lang.String)

isPrincipalInAnyWayShapeOrFormFiscalOfficer

public boolean isPrincipalInAnyWayShapeOrFormFiscalOfficer(String principalId)
Description copied from interface: AccountDao
Determines if the given principal is the fiscal officer of any non-closed account

Specified by:
isPrincipalInAnyWayShapeOrFormFiscalOfficer in interface AccountDao
Parameters:
principalId - the principal to check for the fiscal officer role
Returns:
true if the principal is a fiscal officer for any non-closed account, false otherwise
See Also:
AccountDao.isPrincipalInAnyWayShapeOrFormFiscalOfficer(java.lang.String)

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)

getAccountsForAccountNumber

public Collection<Account> getAccountsForAccountNumber(String accountNumber)
Specified by:
getAccountsForAccountNumber in interface AccountDao
See Also:
AccountDao.getAccountsForAccountNumber(java.lang.String)


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