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 package org.kuali.kfs.module.ld.dataaccess;
017
018 import java.sql.Date;
019 import java.util.Collection;
020 import java.util.Iterator;
021 import java.util.Map;
022
023 import org.kuali.kfs.gl.businessobject.OriginEntryGroup;
024 import org.kuali.kfs.gl.dataaccess.OriginEntryDao;
025 import org.kuali.kfs.module.ld.businessobject.LaborOriginEntry;
026
027 /**
028 * This is the data access object for labor origin entry.
029 *
030 * @see org.kuali.kfs.module.ld.businessobject.LaborOriginEntry
031 */
032 public interface LaborOriginEntryDao extends OriginEntryDao {
033
034 /**
035 * Get origin entries that belong to the given groups
036 *
037 * @param groups the given origin entry groups
038 * @return origin entries that belong to the given groups
039 */
040 Iterator<LaborOriginEntry> getEntriesByGroups(Collection<OriginEntryGroup> groups);
041
042 /**
043 * Get the origin entries that belong to the given group in either the consolidation manner
044 *
045 * @param group the given group
046 * @return the origin entries that belong to the given group in either the consolidation manner
047 */
048 Iterator<Object[]> getConsolidatedEntriesByGroup(OriginEntryGroup group);
049
050 /**
051 * get the count of the origin entry collection in the given groups
052 *
053 * @param groups the given groups
054 * @return the count of the origin entry collection in the given group
055 */
056 int getCountOfEntriesInGroups(Collection<OriginEntryGroup> groups);
057
058 /**
059 * This method should only be used in unit tests. It loads all the ld_lbr_origin_entry_t rows in memory into a collection. This
060 * won't scale for production.
061 *
062 * @return a set of labor origin entries
063 */
064 Collection<LaborOriginEntry> testingLaborGetAllEntries();
065
066 /**
067 * Return an iterator to all the entries in a group
068 *
069 * @param oeg the given origin entry group
070 * @return Iterator of entries in the specified group
071 */
072 Iterator<LaborOriginEntry> getLaborEntriesByGroup(OriginEntryGroup oeg, int sort);
073
074 /**
075 * Collection of entries that match criteria
076 *
077 * @param searchCriteria Map of field, value pairs
078 * @return collection of entries
079 */
080 Collection getMatchingEntriesByCollection(Map searchCriteria);
081
082 /**
083 * Return a collection to all the entries in the given group
084 *
085 * @param group the given origin entry group
086 * @return Collection of entries in the specified group
087 */
088 Collection<LaborOriginEntry> getEntryCollectionByGroup(OriginEntryGroup group);
089
090 /**
091 * Get all the Labor backup groups to scrub (ie, origin entry groups with source OriginEntrySource.LABOR_BACKUP)
092 *
093 * @param groupDate the creation date of labor backup groups to find
094 * @return a Collection of Labor backup groups
095 */
096 public Collection getLaborBackupGroups(Date groupDate);
097
098 /**
099 * Get all the groups to be copied into the backup group
100 *
101 * @param groupDate the date returned origin entry groups must have been created on or before
102 * @return a Collection of Labor Origin Entry Groups to backup
103 */
104 public Collection getLaborGroupsToBackup(Date groupDate);
105 }