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.cg.dao.ojb;
17:
18: import java.util.Collection;
19:
20: import org.apache.ojb.broker.query.Criteria;
21: import org.apache.ojb.broker.query.QueryFactory;
22: import org.kuali.core.dao.ojb.PlatformAwareDaoBaseOjb;
23: import org.kuali.module.cg.bo.Close;
24: import org.kuali.module.cg.bo.Proposal;
25: import org.kuali.module.cg.dao.ProposalDao;
26:
27: /**
28: * @see ProposalDao
29: */
30: public class ProposalDaoOjb extends PlatformAwareDaoBaseOjb implements
31: ProposalDao {
32:
33: /**
34: * @see org.kuali.module.cg.dao.ProposalDao#getProposalsToClose(org.kuali.module.cg.bo.Close)
35: */
36: public Collection<Proposal> getProposalsToClose(Close close) {
37:
38: Criteria criteria = new Criteria();
39: criteria.addIsNull("proposalClosingDate");
40: criteria.addLessOrEqualThan("proposalSubmissionDate", close
41: .getCloseOnOrBeforeDate());
42:
43: return (Collection<Proposal>) getPersistenceBrokerTemplate()
44: .getCollectionByQuery(
45: QueryFactory.newQuery(Proposal.class, criteria));
46: }
47:
48: /**
49: * @see org.kuali.module.cg.dao.ProposalDao#save(org.kuali.module.cg.bo.Proposal)
50: */
51: public void save(Proposal proposal) {
52: getPersistenceBrokerTemplate().store(proposal);
53: }
54:
55: }
|