01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.gl.dao.ojb;
17:
18: import java.util.Collection;
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.core.dao.ojb.PlatformAwareDaoBaseOjb;
24: import org.kuali.module.gl.bo.OriginEntrySource;
25: import org.kuali.module.gl.dao.OriginEntrySourceDao;
26:
27: /**
28: * An OJB implementation of OriginEntrySourceDao
29: */
30: public class OriginEntrySourceDaoOjb extends PlatformAwareDaoBaseOjb
31: implements OriginEntrySourceDao {
32:
33: private static final String FINANCIAL_DOCUMENT_REVERSAL_DATE = "financialDocumentReversalDate";
34: private static final String UNIVERSITY_FISCAL_YEAR = "universityFiscalYear";
35: private static final String CHART_OF_ACCOUNTS_CODE = "chartOfAccountsCode";
36: private static final String ACCOUNT_NUMBER = "accountNumber";
37: private static final String SUB_ACCOUNT_NUMBER = "subAccountNumber";
38: private static final String FINANCIAL_OBJECT_CODE = "financialObjectCode";
39: private static final String FINANCIAL_SUB_OBJECT_CODE = "financialSubObjectCode";
40: private static final String FINANCIAL_BALANCE_TYPE_CODE = "financialBalanceTypeCode";
41: private static final String FINANCIAL_OBJECT_TYPE_CODE = "financialObjectTypeCode";
42: private static final String UNIVERSITY_FISCAL_PERIOD_CODE = "universityFiscalPeriodCode";
43: private static final String FINANCIAL_DOCUMENT_TYPE_CODE = "financialDocumentTypeCode";
44: private static final String FINANCIAL_SYSTEM_ORIGINATION_CODE = "financialSystemOriginationCode";
45: private static final String TRANSACTION_LEDGER_ENTRY_SEQUENCE_NUMBER = "transactionLedgerEntrySequenceNumber";
46:
47: /**
48: * Constructs a OriginEntrySourceDaoOjb instance
49: */
50: public OriginEntrySourceDaoOjb() {
51: super ();
52: }
53:
54: /**
55: * Fetches all origin entry full records in the database
56: *
57: * @return a Collection of all origin entry source records
58: * @see org.kuali.module.gl.dao.OriginEntrySourceDao#findAll()
59: */
60: public Collection findAll() {
61: QueryByCriteria query = QueryFactory.newQuery(
62: OriginEntrySource.class, (Criteria) null);// "SELECT * FROM
63: // GL_ORIGIN_ENTRY_SRC_T");
64: Collection thawed = getPersistenceBrokerTemplate()
65: .getCollectionByQuery(query);
66: // Collection frozen = Collections.unmodifiableCollection(thawed);
67: return thawed;
68: }
69:
70: /**
71: * Finds an origin entry source record based on its source code
72: *
73: * @param code the code of the origin entry source record to find
74: * @return an Origin Entry Source record if found, or null if not found
75: * @see org.kuali.module.gl.dao.OriginEntrySourceDao#findBySourceCode(java.lang.String)
76: */
77: public OriginEntrySource findBySourceCode(String code) {
78: Criteria criteria = new Criteria();
79: criteria.addEqualTo("code", code);
80: QueryByCriteria query = QueryFactory.newQuery(
81: OriginEntrySource.class, criteria);
82: return (OriginEntrySource) getPersistenceBrokerTemplate()
83: .getObjectByQuery(query);
84: }
85:
86: }
|