01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.gl.dao.ojb;
17:
18: import java.sql.Date;
19: import java.util.Collection;
20:
21: import org.apache.ojb.broker.query.Criteria;
22: import org.apache.ojb.broker.query.QueryFactory;
23: import org.kuali.core.dao.ojb.PlatformAwareDaoBaseOjb;
24: import org.kuali.kfs.KFSConstants;
25: import org.kuali.kfs.KFSPropertyConstants;
26: import org.kuali.module.gl.dao.CorrectionDocumentDao;
27: import org.kuali.module.gl.document.CorrectionDocument;
28:
29: /**
30: * The OJB implementation of CorrectionDocumentDao
31: */
32: public class CorrectionDocumentDaoOjb extends PlatformAwareDaoBaseOjb
33: implements CorrectionDocumentDao {
34:
35: /**
36: * Queries the database to get a Collection of GLCP documents finalized on the given date
37: *
38: * @param date the finalization date of GLCP documents to find
39: * @return a Collection of GLCP documents
40: */
41: public Collection<CorrectionDocument> getCorrectionDocumentsFinalizedOn(
42: Date documentFinalDate) {
43: Criteria criteria = new Criteria();
44: criteria.addEqualTo(KFSConstants.DOCUMENT_HEADER_PROPERTY_NAME
45: + "." + KFSPropertyConstants.DOCUMENT_FINAL_DATE,
46: documentFinalDate);
47: return getPersistenceBrokerTemplate().getCollectionByQuery(
48: QueryFactory.newQuery(CorrectionDocument.class,
49: criteria));
50: }
51: }
|