001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.gl.dao;
017:
018: import java.sql.Date;
019: import java.util.Collection;
020: import java.util.Map;
021:
022: import org.kuali.module.gl.bo.OriginEntryGroup;
023:
024: public interface OriginEntryGroupDao {
025: /**
026: * Given an origin entry group source type (defined in OriginEntrySource)
027: *
028: * @param sourceCode the source code of the groups to find
029: * @return a OriginEntryGroup with the given source code and max ORIGIN_ENTRY_GRP_ID
030: * @see org.kuali.module.gl.bo.OriginEntrySource
031: */
032: public OriginEntryGroup getGroupWithMaxIdFromSource(
033: String sourceCode);
034:
035: /**
036: * Get all the groups that are older than a date
037: *
038: * @param day the date groups returned should be older than
039: * @return a Collection of origin entry groups older than that date
040: */
041: public Collection<OriginEntryGroup> getOlderGroups(Date day);
042:
043: /**
044: * Delete all the groups in the list. Note...it doesn't delete the entries within them, you need
045: * OriginEntryDao.deleteGroups for that
046: *
047: * @params groups a Collection of origin entry groups to delete
048: */
049: public void deleteGroups(Collection<OriginEntryGroup> groups);
050:
051: /**
052: * Fetch all the groups that match the criteria
053: *
054: * @param searchCriteria a Map of search criteria to form the query
055: * @return a Collection of Origin Entry Groups that match that criteria
056: */
057: public Collection getMatchingGroups(Map searchCriteria);
058:
059: /**
060: * Get all the groups for the poster (that is to say, Groups with "Process" being true)
061: *
062: * @param groupSourceCode the source code of origin entry groups to return
063: * @return a Collection of origin entry groups that should be processed by the poster
064: */
065: public Collection getPosterGroups(String groupSourceCode);
066:
067: /**
068: * Gets a collection of all backup groups that are scrubbable (i.e. valid, process, scrub indicators all set to true)
069: *
070: * @return a Collection of scrubbable origin entry groups
071: */
072: public Collection<OriginEntryGroup> getAllScrubbableBackupGroups();
073:
074: /**
075: * Get all the Labor backup groups to scrub (ie, origin entry groups with source OriginEntrySource.LABOR_BACKUP)
076: *
077: * @param groupDate the creation date of labor backup groups to find
078: * @return a Collection of Labor backup groups
079: */
080: public Collection getLaborBackupGroups(Date groupDate);
081:
082: /**
083: * Get all the groups to be copied into the backup group
084: *
085: * @param groupDate the date returned origin entry groups must have been created on or before
086: * @return a Collection of origin entry groups to backup
087: */
088: public Collection getGroupsToBackup(Date groupDate);
089:
090: /**
091: * Get all the groups to be copied into the backup group
092: *
093: * @param groupDate the date returned origin entry groups must have been created on or before
094: * @return a Collection of Labor Origin Entry Groups to backup
095: */
096: public Collection getLaborGroupsToBackup(Date groupDate);
097:
098: /**
099: * Save a group
100: *
101: * @param group a group to save
102: */
103: public void save(OriginEntryGroup group);
104:
105: /**
106: * The the group for the ID passed. The EXACT one, not one that is close, it must be EXACTLY EXACT.
107: *
108: * @param id the group id of the group to return
109: * @return a highly exact origin entry group, or, if not found, null
110: */
111: public OriginEntryGroup getExactMatchingEntryGroup(Integer id);
112:
113: /**
114: * Fetches groups created on or after the given date
115: *
116: * @param day the date origin entry groups to return must have been created on or after
117: * @return a Collection of origin entry groups created on or after that day
118: */
119: public Collection<OriginEntryGroup> getRecentGroups(Date day);
120: }
|