001 /** 002 * Copyright 2004-2013 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.hr.job.dao; 017 018 import org.kuali.hr.job.Job; 019 020 import java.util.Date; 021 import java.util.List; 022 023 public interface JobDao { 024 025 /** 026 * Saves or Updates a Job 027 * @param job 028 */ 029 public void saveOrUpdate(Job job); 030 /** 031 * Saves or updates a job list 032 * @param jobList 033 */ 034 public void saveOrUpdate(List<Job> jobList); 035 036 /** 037 * Provides a list of current jobs that are valid relative to the provided effective date. 038 * Timestamp of row creation is taken into account when two rows with the same job number 039 * have the same effective date. 040 * 041 * @param principalId 042 * @param payPeriodEndDate 043 * @return 044 */ 045 public List<Job> getJobs(String principalId, Date payPeriodEndDate); 046 /** 047 * 048 * @param principalId 049 * @param jobNumber 050 * @param asOfDate 051 * @return a Job per the critieria passed in 052 */ 053 public Job getJob(String principalId, Long jobNumber, Date asOfDate); 054 055 /** 056 * Get Primary Job as indicated by primary indicator on Job table 057 * @param principalId 058 * @param payPeriodEndDate 059 * @return 060 */ 061 public Job getPrimaryJob(String principalId, Date payPeriodEndDate); 062 /** 063 * Fetch active jobs that are incumbents of the position 064 * @param positionNbr 065 * @param asOfDate 066 * @return 067 */ 068 public List<Job> getActiveJobsForPosition(String positionNbr, Date asOfDate); 069 070 /** 071 * Fetch active jobs that are incumbents of the payType 072 * @param hrPayType 073 * @param asOfDate 074 * @return 075 */ 076 public List<Job> getActiveJobsForPayType(String hrPayType, Date asOfDate); 077 078 /** 079 * Get job based on id 080 * @param hrJobId 081 * @return 082 */ 083 public Job getJob(String hrJobId); 084 085 /** 086 * Get job with max(jobNumber) for a certain principalId 087 * @param principalId 088 * @return 089 */ 090 public Job getMaxJob(String principalId); 091 092 List<Job> getJobs(String principalId, String jobNumber, String dept, String positionNbr, String payType, Date fromEffdt, Date toEffdt, String active, 093 String showHistory); 094 095 /** 096 * Fetch the count of the jobs with the given principalId and jobNumber 097 * @param principalId 098 * @param jobNumber 099 * @return the count of the jobs with the given principalId and jobNumber 100 */ 101 public int getJobCount(String principalId, Long jobNumber, String dept); 102 103 public List<Job> getActiveLeaveJobs(String principalId, Date asOfDate); 104 105 public List<Job> getAllActiveLeaveJobs(String principalId, Date asOfDate); 106 107 public List<Job> getInactiveLeaveJobs(Long jobNumber, Date startDate, Date endDate); 108 109 public List<Job> getAllInActiveLeaveJobsInRange(String principalId, Date startDate, Date endDate); 110 111 public Job getMaxTimestampJob(String principalId); 112 }