1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.dataaccess.impl;
17
18 import java.util.Collection;
19
20 import org.apache.log4j.Logger;
21 import org.apache.ojb.broker.query.Criteria;
22 import org.apache.ojb.broker.query.QueryByCriteria;
23 import org.apache.ojb.broker.query.QueryFactory;
24 import org.kuali.ole.fp.businessobject.Check;
25 import org.kuali.ole.fp.businessobject.CheckBase;
26 import org.kuali.ole.fp.dataaccess.CheckDao;
27 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
28 import org.springframework.dao.DataAccessException;
29
30
31
32
33
34 public class CheckDaoOjb extends PlatformAwareDaoBaseOjb implements CheckDao {
35 private static final Logger LOG = Logger.getLogger(CheckDaoOjb.class);
36
37
38
39
40
41 public void deleteCheck(Check check) throws DataAccessException {
42 getPersistenceBrokerTemplate().delete(check);
43 }
44
45
46
47
48
49
50
51
52 public Collection<CheckBase> findByDocumentHeaderId(String documentHeaderId) throws DataAccessException {
53 Criteria criteria = new Criteria();
54 criteria.addEqualTo("FDOC_NBR", documentHeaderId);
55
56 QueryByCriteria query = QueryFactory.newQuery(CheckBase.class, criteria);
57
58 Collection<CheckBase> lines = getPersistenceBrokerTemplate().getCollectionByQuery(query);
59
60 return lines;
61 }
62 }