org.kuali.kfs.gl.dataaccess.impl
Class OriginEntryDaoOjb

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.gl.dataaccess.impl.OriginEntryDaoOjb
All Implemented Interfaces:
OriginEntryDao, org.kuali.rice.kns.dao.PlatformAwareDao, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
LaborOriginEntryDaoOjb

public class OriginEntryDaoOjb
extends org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
implements OriginEntryDao

An OJB implementation of the OriginEntryDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Fields inherited from interface org.kuali.kfs.gl.dataaccess.OriginEntryDao
SORT_ACCOUNT, SORT_DOCUMENT, SORT_LISTING_REPORT, SORT_REPORT
 
Constructor Summary
OriginEntryDaoOjb()
          Constructs a OriginEntryDaoOjb instance
 
Method Summary
 void deleteEntry(OriginEntryInformation oe)
          Delete an entry from the database
 void deleteGroups(Collection<OriginEntryGroup> groups)
          Delete all the groups in the list.
 void deleteMatchingEntries(Map searchCriteria)
          Delete entries matching searchCriteria search criteria.
 Iterator<OriginEntryFull> getBadBalanceEntries(Collection groups)
          Get bad balance entries
 Iterator getDocumentsByGroup(OriginEntryGroup oeg)
          Return an iterator of keys of all documents referenced by origin entries in a given group
<T> Iterator<T>
getEntriesByGroup(OriginEntryGroup oeg, int sort)
          This method is special because of the order by.
 Class getEntryClass()
          Gets the entryClass attribute.
 OriginEntryFull getExactMatchingEntry(Integer entryId)
          Fetches an entry for the given entryId, or returns a newly created on
 Integer getGroupCount(Integer groupId)
          Counts the number of entries in a group
 Iterator getGroupCounts()
          Counts of rows of all the origin entry groups
 org.kuali.rice.kns.util.KualiDecimal getGroupTotal(Integer groupId, boolean isCredit)
          Get the total amount of transactions in a group
 Iterator<OriginEntryFull> getMatchingEntries(Map searchCriteria)
          Iterator of entries that match criteria
 Collection<OriginEntryFull> getMatchingEntriesByCollection(Map searchCriteria)
          Collection of entries that match criteria
 Iterator getPosterOutputSummaryByGroupId(Collection groups)
          get the summarized information of poster input entries that belong to the entry groups with the given group id list
 Iterator getSummaryByGroupId(Collection groupIdList)
          get the summarized information of the entries that belong to the entry groups with the given group ids
 void saveOriginEntry(OriginEntryInformation entry)
          Saves an origin entry to the database
 void setEntryClass(Class entryClass)
          Sets the class of the origin entries this class deals with.
 Collection<OriginEntryFull> testingGetAllEntries()
          This method should only be used in unit tests.
 
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

OriginEntryDaoOjb

public OriginEntryDaoOjb()
Constructs a OriginEntryDaoOjb instance

Method Detail

setEntryClass

public void setEntryClass(Class entryClass)
Sets the class of the origin entries this class deals with. This makes this particular class very flexible; instances of it can deal with OriginEntryLites as well as they deal with OriginEntryFulls.

Parameters:
entryClass - the class of OriginEntries this instance will use for OJB operations

getEntryClass

public Class getEntryClass()
Gets the entryClass attribute.

Returns:
Returns the entryClass.

getGroupTotal

public org.kuali.rice.kns.util.KualiDecimal getGroupTotal(Integer groupId,
                                                          boolean isCredit)
Get the total amount of transactions in a group

Specified by:
getGroupTotal in interface OriginEntryDao
Parameters:
the - id of the origin entry group to total
isCredit - whether the total should be of credits or not
Returns:
the sum of all queried origin entries
See Also:
OriginEntryDao.getGroupTotal(java.lang.Integer, boolean)

getGroupCount

public Integer getGroupCount(Integer groupId)
Counts the number of entries in a group

Specified by:
getGroupCount in interface OriginEntryDao
Parameters:
the - id of an origin entry group
Returns:
the count of the entries in that group
See Also:
OriginEntryDao.getGroupCount(java.lang.Integer)

getGroupCounts

public Iterator getGroupCounts()
Counts of rows of all the origin entry groups

Specified by:
getGroupCounts in interface OriginEntryDao
Returns:
iterator of Object[] {[BigDecimal id,BigDecimal count]}
See Also:
OriginEntryDao.getGroupCounts()

deleteEntry

public void deleteEntry(OriginEntryInformation oe)
Delete an entry from the database

Specified by:
deleteEntry in interface OriginEntryDao
Parameters:
oe - the entry to delete
See Also:
OriginEntryDao.deleteEntry(org.kuali.kfs.gl.businessobject.OriginEntryInformation)

getDocumentsByGroup

public Iterator getDocumentsByGroup(OriginEntryGroup oeg)
Return an iterator of keys of all documents referenced by origin entries in a given group

Specified by:
getDocumentsByGroup in interface OriginEntryDao
Parameters:
oeg - Group the origin entry group to find entries in, by origin entry
Returns:
Iterator of java.lang.Object[] with report data about all of the distinct document numbers/type code/origination code combinations of origin entries in the group
See Also:
OriginEntryDao.getDocumentsByGroup(org.kuali.kfs.gl.businessobject.OriginEntryGroup)

getMatchingEntries

public Iterator<OriginEntryFull> getMatchingEntries(Map searchCriteria)
Iterator of entries that match criteria

Specified by:
getMatchingEntries in interface OriginEntryDao
Parameters:
searchCriteria - Map of field, value pairs
Returns:
collection of entries
See Also:
OriginEntryDao.getMatchingEntries(java.util.Map)

getBadBalanceEntries

public Iterator<OriginEntryFull> getBadBalanceEntries(Collection groups)
Get bad balance entries

Specified by:
getBadBalanceEntries in interface OriginEntryDao
Parameters:
groups - a Collection of groups to remove bad entries in
Returns:
an Iterator of no good, won't use, bad balance entries
See Also:
OriginEntryDao.getBadBalanceEntries(java.util.Collection)

getEntriesByGroup

public <T> Iterator<T> getEntriesByGroup(OriginEntryGroup oeg,
                                         int sort)
This method is special because of the order by. It is used in the scrubber. The getMatchingEntries wouldn't work because of the required order by.

Specified by:
getEntriesByGroup in interface OriginEntryDao
Parameters:
OriginEntryGroup - the originEntryGroup that holds the origin entries to find
sort - the sort order to sort entries by, defined in OriginEntryDao
Returns:
an Iterator of whichever flavor of OriginEntries this instance uses

testingGetAllEntries

public Collection<OriginEntryFull> testingGetAllEntries()
This method should only be used in unit tests. It loads all the gl_origin_entry_t rows in memory into a collection. This won't work for production because there would be too many rows to load into memory.

Specified by:
testingGetAllEntries in interface OriginEntryDao
Returns:
a collection of OriginEntryFulls

saveOriginEntry

public void saveOriginEntry(OriginEntryInformation entry)
Saves an origin entry to the database

Specified by:
saveOriginEntry in interface OriginEntryDao
Parameters:
entry - the entry to save.

deleteMatchingEntries

public void deleteMatchingEntries(Map searchCriteria)
Delete entries matching searchCriteria search criteria.

Specified by:
deleteMatchingEntries in interface OriginEntryDao
Parameters:
searchCriteria - a map of criteria to use as keys for building a query

deleteGroups

public void deleteGroups(Collection<OriginEntryGroup> groups)
Delete all the groups in the list. This will delete the entries. The OriginEntryGroupDao has a method to delete the groups, and one has to use both to really delete the whole group

Specified by:
deleteGroups in interface OriginEntryDao
Parameters:
groups - a Collection of Origin Entry Groups to delete entries in
See Also:
OriginEntryDao.deleteGroups(java.util.Collection)

getMatchingEntriesByCollection

public Collection<OriginEntryFull> getMatchingEntriesByCollection(Map searchCriteria)
Collection of entries that match criteria

Specified by:
getMatchingEntriesByCollection in interface OriginEntryDao
Parameters:
searchCriteria - Map of field, value pairs
Returns:
collection of entries
See Also:
OriginEntryDao.getMatchingEntriesByCollection(java.util.Map)

getSummaryByGroupId

public Iterator getSummaryByGroupId(Collection groupIdList)
get the summarized information of the entries that belong to the entry groups with the given group ids

Specified by:
getSummaryByGroupId in interface OriginEntryDao
Parameters:
groupIdList - the ids of origin entry groups
Returns:
a set of summarized information of the entries within the specified groups
See Also:
org.kuali.kfs.gl.dataaccess.OriginEntryDao#getSummaryByGroupId(java.util.List)

getExactMatchingEntry

public OriginEntryFull getExactMatchingEntry(Integer entryId)
Fetches an entry for the given entryId, or returns a newly created on

Specified by:
getExactMatchingEntry in interface OriginEntryDao
Parameters:
entryId - an entry id to find an entry for
Returns:
the entry for the given entry id, or a newly created entry
See Also:
OriginEntryDao.getExactMatchingEntry(java.lang.Integer)

getPosterOutputSummaryByGroupId

public Iterator getPosterOutputSummaryByGroupId(Collection groups)
get the summarized information of poster input entries that belong to the entry groups with the given group id list

Specified by:
getPosterOutputSummaryByGroupId in interface OriginEntryDao
Parameters:
groups - the origin entry groups
Returns:
a set of summarized information of poster input entries within the specified groups
See Also:
OriginEntryDao.getPosterOutputSummaryByGroupId(java.util.Collection)


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