1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.dataaccess.impl;
17
18 import org.apache.ojb.broker.query.Criteria;
19 import org.apache.ojb.broker.query.QueryByCriteria;
20 import org.apache.ojb.broker.query.QueryFactory;
21 import org.kuali.ole.module.purap.businessobject.PurchaseOrderVendorQuote;
22 import org.kuali.ole.module.purap.document.*;
23 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
24
25 import java.util.List;
26
27
28
29
30
31 public class PurapDocumentsStatusCodeMigrationDaoOjb extends PlatformAwareDaoBaseOjb {
32 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PurapDocumentsStatusCodeMigrationDaoOjb.class);
33
34 public List<RequisitionDocument> getRequisitionDocumentsForStatusCodeMigration() {
35 LOG.debug("getRequisitionDocumentsForStatusCodeMigration() started");
36
37 Criteria criteria = new Criteria();
38 criteria.addNotNull("REQS_STAT_CD");
39
40 QueryByCriteria query = QueryFactory.newQuery(RequisitionDocument.class, criteria);
41 return (List<RequisitionDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(query);
42 }
43
44
45
46
47 public List<PurchaseOrderDocument> getPurchaseOrderDocumentsForStatusCodeMigration() {
48 LOG.debug("getPurchaseOrderDocumentsForStatusCodeMigration() started");
49
50 Criteria criteria = new Criteria();
51 criteria.addNotNull("PO_STAT_CD");
52
53 QueryByCriteria query = QueryFactory.newQuery(PurchaseOrderDocument.class, criteria);
54 return (List<PurchaseOrderDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(query);
55 }
56
57
58
59
60 public List<PurchaseOrderVendorQuote> getPurchaseOrderVendorQuoteDocumentsForStatusCodeMigration() {
61 LOG.debug("getPurchaseOrderVendorQuoteDocumentsForStatusCodeMigration() started");
62
63 Criteria criteria = new Criteria();
64 criteria.addNotNull("PO_QT_STAT_CD");
65
66 QueryByCriteria query = QueryFactory.newQuery(PurchaseOrderVendorQuote.class, criteria);
67 return (List<PurchaseOrderVendorQuote>) getPersistenceBrokerTemplate().getCollectionByQuery(query);
68 }
69
70
71
72
73 public List<PaymentRequestDocument> getPaymentRequestDocumentsForStatusCodeMigration() {
74 LOG.debug("getPaymentRequestDocumentsForStatusCodeMigration() started");
75
76 Criteria criteria = new Criteria();
77 criteria.addNotNull("PMT_RQST_STAT_CD");
78
79 QueryByCriteria query = QueryFactory.newQuery(PaymentRequestDocument.class, criteria);
80 return (List<PaymentRequestDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(query);
81 }
82
83
84
85
86 public List<VendorCreditMemoDocument> getVendorCreditMemoDocumentsForStatusCodeMigration() {
87 LOG.debug("getVendorCreditMemoDocumentsForStatusCodeMigration() started");
88
89 Criteria criteria = new Criteria();
90 criteria.addNotNull("CRDT_MEMO_STAT_CD");
91
92 QueryByCriteria query = QueryFactory.newQuery(VendorCreditMemoDocument.class, criteria);
93 return (List<VendorCreditMemoDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(query);
94 }
95
96
97
98
99 public List<LineItemReceivingDocument> getLineItemReceivingDocumentDocumentsForStatusCodeMigration() {
100 LOG.debug("getLineItemReceivingDocumentDocumentsForStatusCodeMigration() started");
101
102 Criteria criteria = new Criteria();
103 criteria.addNotNull("RCVNG_LN_STAT_CD");
104
105 QueryByCriteria query = QueryFactory.newQuery(LineItemReceivingDocument.class, criteria);
106 return (List<LineItemReceivingDocument>) getPersistenceBrokerTemplate().getCollectionByQuery(query);
107 }
108 }