1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.dataaccess.impl;
17
18 import java.util.List;
19
20 import org.apache.ojb.broker.query.Criteria;
21 import org.apache.ojb.broker.query.QueryByCriteria;
22 import org.apache.ojb.broker.query.QueryFactory;
23 import org.kuali.ole.gl.businessobject.CorrectionChange;
24 import org.kuali.ole.gl.dataaccess.CorrectionChangeDao;
25 import org.kuali.ole.sys.OLEPropertyConstants;
26 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
27
28
29
30
31 public class CorrectionChangeDaoOjb extends PlatformAwareDaoBaseOjb implements CorrectionChangeDao {
32 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CorrectionChangeDaoOjb.class);
33
34
35
36
37
38
39
40 public void delete(CorrectionChange spec) {
41 LOG.debug("delete() started");
42
43 getPersistenceBrokerTemplate().delete(spec);
44 }
45
46
47
48
49
50
51
52
53
54
55 public List findByDocumentHeaderIdAndCorrectionGroupNumber(String documentNumber, Integer correctionGroupLineNumber) {
56 LOG.debug("findByDocumentHeaderIdAndCorrectionGroupNumber() started");
57
58 Criteria criteria = new Criteria();
59 criteria.addEqualTo(OLEPropertyConstants.DOCUMENT_NUMBER, documentNumber);
60 criteria.addEqualTo("correctionChangeGroupLineNumber", correctionGroupLineNumber);
61
62 QueryByCriteria query = QueryFactory.newQuery(CorrectionChange.class, criteria);
63
64 return (List) getPersistenceBrokerTemplate().getCollectionByQuery(query);
65 }
66
67 }