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.sys.dataaccess;
017
018 import java.sql.Date;
019 import java.util.Collection;
020
021 import org.kuali.kfs.sys.businessobject.UniversityDate;
022
023 /**
024 * An DAO interface declaring methods needed by UniversityDates to interact with the database
025 */
026 public interface UniversityDateDao {
027 /**
028 * Returns a university date record based on a given java.sql.Date
029 *
030 * @param date a Date to find the corresponding University Date record
031 * @return a University Date record if found, null if not
032 */
033 public UniversityDate getByPrimaryKey(Date date);
034
035 /**
036 * Returns a university date record based on java.util.Date
037 *
038 * @param date a java.util.Date to find the corresponding University Date record
039 * @return a University Date record if found, null if not
040 */
041 public UniversityDate getByPrimaryKey(java.util.Date date);
042
043 /**
044 * Returns the last university date for a given fiscal year
045 *
046 * @param fiscalYear the fiscal year to find the last date for
047 * @return a UniversityDate record for the last day in the given fiscal year, or null if nothing can be found
048 */
049 public UniversityDate getLastFiscalYearDate(Integer fiscalYear);
050
051 /**
052 * Returns the first university date for a given fiscal year
053 *
054 * @param fiscalYear the fiscal year to find the first date for
055 * @return a UniversityDate record for the first day of the given fiscal year, or null if nothing can be found
056 */
057 public UniversityDate getFirstFiscalYearDate(Integer fiscalYear);
058
059 /**
060 * Returns all distinct accounting period codes from the table
061 *
062 * @return a Collection of all distinct accounting period codes represented by UniversityDate records in the database
063 */
064 public Collection getAccountingPeriodCode();
065 }