1 /**
2 * Copyright 2004-2013 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.hr.time.assignment.dao;
17
18 import org.kuali.hr.time.assignment.Assignment;
19
20 import java.sql.Date;
21 import java.util.List;
22
23 public interface AssignmentDao {
24
25 /**
26 * Returns all assignments for the provided principalId that are valid as of
27 * the specified payPeriodEndDate.
28 *
29 * @param principalId
30 * @param payPeriodEndDate
31 * @return
32 */
33 public List<Assignment> findAssignments(String principalId, Date asOfDate);
34 /**
35 * Save or update the given assignment
36 * @param assignment
37 */
38 public void saveOrUpdate(Assignment assignment);
39 /**
40 * Save of update the given list of assignments
41 * @param assignments
42 */
43 public void saveOrUpdate(List<Assignment> assignments);
44
45 /**
46 * Delete an assignment
47 * @param assignment
48 */
49 public void delete(Assignment assignment);
50
51 /**
52 * Get list of active assignments in a given work area as of a particular date
53 * @param workArea
54 * @param asOfDate
55 * @return
56 */
57 public List<Assignment> getActiveAssignmentsInWorkArea(Long workArea, Date asOfDate);
58
59 public Assignment getAssignment(String tkAssignmentId);
60
61 public Assignment getAssignment(Long job, Long workArea, Long task, Date asOfDate);
62
63 public List<Assignment> getActiveAssignments(Date asOfDate);
64
65 public Assignment getAssignment(String principalId, Long jobNumber, Long workArea, Long task, Date asOfDate);
66
67 /**
68 * KPME-1129
69 * Get a list of active assignments based on principalId and jobNumber as of a particular date
70 * @param principalId
71 * @param jobNumber
72 * @param asOfDate
73 * @return
74 */
75 public List<Assignment> getActiveAssignmentsForJob(String principalId, Long jobNumber, Date asOfDate);
76
77 List<Assignment> findAssignmentsWithinPeriod(String principalId, Date startDate, Date endDate);
78
79 List<Assignment> searchAssignments(Date fromEffdt, Date toEffdt, String principalId, String jobNumber,
80 String dept, String workArea, String active, String showHistory);
81
82 public Assignment getMaxTimestampAssignment(String principalId);
83 }