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.kfs.dao.ojb;
17:
18: import org.apache.log4j.Logger;
19: import org.apache.ojb.broker.query.Criteria;
20: import org.apache.ojb.broker.query.QueryByCriteria;
21: import org.apache.ojb.broker.query.QueryFactory;
22: import org.kuali.core.dao.ojb.PlatformAwareDaoBaseOjb;
23: import org.kuali.kfs.bo.OriginationCode;
24: import org.kuali.kfs.dao.OriginationCodeDao;
25:
26: public class OriginationCodeDaoOjb extends PlatformAwareDaoBaseOjb
27: implements OriginationCodeDao {
28: private static Logger LOG = Logger
29: .getLogger(OriginationCodeDaoOjb.class);
30:
31: public OriginationCodeDaoOjb() {
32: super ();
33: }
34:
35: /*
36: * (non-Javadoc)
37: *
38: * @see org.kuali.core.dao.OriginationCodeDao#delete(org.kuali.core.bo.OriginationCode)
39: */
40: public void delete(OriginationCode code) {
41: getPersistenceBrokerTemplate().delete(code);
42: }
43:
44: /*
45: * (non-Javadoc)
46: *
47: * @see org.kuali.core.dao.OriginationCodeDao#findByCode(java.lang.String)
48: */
49: public OriginationCode findByCode(String originationCode) {
50: // TODO Auto-generated method stub
51: Criteria criteria = new Criteria();
52: criteria.addEqualTo("FS_ORIGIN_CD", originationCode);
53:
54: QueryByCriteria query = QueryFactory.newQuery(
55: OriginationCode.class, criteria);
56: return (OriginationCode) getPersistenceBrokerTemplate()
57: .getObjectByQuery(query);
58: }
59:
60: /*
61: * (non-Javadoc)
62: *
63: * @see org.kuali.core.dao.OriginationCodeDao#save(org.kuali.core.bo.OriginationCode)
64: */
65: public void save(OriginationCode code) {
66: getPersistenceBrokerTemplate().store(code);
67: }
68:
69: }
|