1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.dao.impl;
17
18 import org.apache.ojb.broker.query.Criteria;
19 import org.apache.ojb.broker.query.QueryFactory;
20 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
21 import org.kuali.rice.krad.bo.DocumentHeader;
22 import org.kuali.rice.krad.dao.DocumentHeaderDao;
23 import org.kuali.rice.krad.util.KRADPropertyConstants;
24
25
26
27
28
29 public class DocumentHeaderDaoOjb extends PlatformAwareDaoBaseOjb implements DocumentHeaderDao {
30 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DocumentHeaderDaoOjb.class);
31
32 private Class documentHeaderBaseClass = DocumentHeader.class;
33
34
35
36
37 public DocumentHeaderDaoOjb() {
38 super();
39 }
40
41
42
43
44 public DocumentHeader getByDocumentHeaderId(String id) {
45 Criteria criteria = new Criteria();
46 criteria.addEqualTo(KRADPropertyConstants.DOCUMENT_NUMBER, id);
47
48 return (DocumentHeader) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(getDocumentHeaderBaseClass(), criteria));
49 }
50
51
52
53
54
55
56 public Class getDocumentHeaderBaseClass() {
57 return this.documentHeaderBaseClass;
58 }
59
60
61
62
63 public void setDocumentHeaderBaseClass(Class documentHeaderBaseClass) {
64 this.documentHeaderBaseClass = documentHeaderBaseClass;
65 }
66
67 }