1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.dataaccess.impl;
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.ole.sys.businessobject.OriginationCode;
23 import org.kuali.ole.sys.dataaccess.OriginationCodeDao;
24 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
25
26 public class OriginationCodeDaoOjb extends PlatformAwareDaoBaseOjb implements OriginationCodeDao {
27 private static Logger LOG = Logger.getLogger(OriginationCodeDaoOjb.class);
28
29 public OriginationCodeDaoOjb() {
30 super();
31 }
32
33
34
35
36
37
38 public void delete(OriginationCode code) {
39 getPersistenceBrokerTemplate().delete(code);
40 }
41
42
43
44
45
46
47 public OriginationCode findByCode(String originationCode) {
48
49 Criteria criteria = new Criteria();
50 criteria.addEqualTo("FS_ORIGIN_CD", originationCode);
51
52 QueryByCriteria query = QueryFactory.newQuery(OriginationCode.class, criteria);
53 return (OriginationCode) getPersistenceBrokerTemplate().getObjectByQuery(query);
54 }
55
56 }