Source Code Cross Referenced for ExpenditureTransactionDaoOjb.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » dao » ojb » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » org.kuali.module.gl.dao.ojb 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2007 The Kuali Foundation.
003:         * 
004:         * Licensed under the Educational Community License, Version 1.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         * http://www.opensource.org/licenses/ecl1.php
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.kuali.module.gl.dao.ojb;
017:
018:        import java.util.Iterator;
019:
020:        import org.apache.ojb.broker.query.Criteria;
021:        import org.apache.ojb.broker.query.QueryByCriteria;
022:        import org.apache.ojb.broker.query.QueryFactory;
023:        import org.kuali.core.dao.ojb.PlatformAwareDaoBaseOjb;
024:        import org.kuali.module.gl.GLConstants;
025:        import org.kuali.module.gl.bo.ExpenditureTransaction;
026:        import org.kuali.module.gl.bo.Transaction;
027:        import org.kuali.module.gl.dao.ExpenditureTransactionDao;
028:
029:        /**
030:         * The OJB implmentation of ExpenditureTransactionDao
031:         */
032:        public class ExpenditureTransactionDaoOjb extends
033:                PlatformAwareDaoBaseOjb implements  ExpenditureTransactionDao {
034:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
035:                    .getLogger(ExpenditureTransactionDaoOjb.class);
036:
037:            private final static String UNIVERISITY_FISCAL_YEAR = "universityFiscalYear";
038:            private final static String CHART_OF_ACCOUNTS_CODE = "chartOfAccountsCode";
039:            private final static String ACCOUNT_NUMBER = "accountNumber";
040:            private final static String SUB_ACCOUNT_NUMBER = "subAccountNumber";
041:            private final static String OBJECT_CODE = "objectCode";
042:            private final static String BALANCE_TYPE_CODE = "balanceTypeCode";
043:            private final static String OBJECT_TYPE_CODE = "objectTypeCode";
044:            private final static String UNIVERSITY_FISCAL_ACCOUNTING_PERIOD = "universityFiscalAccountingPeriod";
045:            private final static String SUB_OBJECT_CODE = "subObjectCode";
046:            private final static String PROJECT_CODE = "projectCode";
047:            private final static String ORGANIZATION_REFERENCE_ID = "organizationReferenceId";
048:
049:            /**
050:             * Constructs a ExpenditureTransactionDaoOjb instance
051:             */
052:            public ExpenditureTransactionDaoOjb() {
053:                super ();
054:            }
055:
056:            /**
057:             * Queries the database to find the expenditure transaction in the database that would be affected if the given transaction is posted
058:             * 
059:             * @param t a transaction to find a related expenditure transaction for
060:             * @return the expenditure transaction if found, null otherwise
061:             * @see org.kuali.module.gl.dao.ExpenditureTransactionDao#getByTransaction(org.kuali.module.gl.bo.Transaction)
062:             */
063:            public ExpenditureTransaction getByTransaction(Transaction t) {
064:                LOG.debug("getByTransaction() started");
065:
066:                Criteria crit = new Criteria();
067:                crit.addEqualTo(UNIVERISITY_FISCAL_YEAR, t
068:                        .getUniversityFiscalYear());
069:                crit.addEqualTo(CHART_OF_ACCOUNTS_CODE, t
070:                        .getChartOfAccountsCode());
071:                crit.addEqualTo(ACCOUNT_NUMBER, t.getAccountNumber());
072:                crit.addEqualTo(SUB_ACCOUNT_NUMBER, t.getSubAccountNumber());
073:                crit.addEqualTo(OBJECT_CODE, t.getFinancialObjectCode());
074:                crit.addEqualTo(SUB_OBJECT_CODE, t.getFinancialSubObjectCode());
075:                crit.addEqualTo(BALANCE_TYPE_CODE, t
076:                        .getFinancialBalanceTypeCode());
077:                crit.addEqualTo(OBJECT_TYPE_CODE, t
078:                        .getFinancialObjectTypeCode());
079:                crit.addEqualTo(UNIVERSITY_FISCAL_ACCOUNTING_PERIOD, t
080:                        .getUniversityFiscalPeriodCode());
081:                crit.addEqualTo(PROJECT_CODE, t.getProjectCode());
082:
083:                if (t.getOrganizationReferenceId() == null) {
084:                    crit.addEqualTo(ORGANIZATION_REFERENCE_ID, GLConstants
085:                            .getDashOrganizationReferenceId());
086:                } else {
087:                    crit.addEqualTo("organizationReferenceId", t
088:                            .getOrganizationReferenceId());
089:                }
090:
091:                QueryByCriteria qbc = QueryFactory.newQuery(
092:                        ExpenditureTransaction.class, crit);
093:                return (ExpenditureTransaction) getPersistenceBrokerTemplate()
094:                        .getObjectByQuery(qbc);
095:            }
096:
097:            /**
098:             * Fetches all expenditure transactions currently in the database
099:             * 
100:             * @return an Iterator with all expenditure transactions from the database
101:             * @see org.kuali.module.gl.dao.ExpenditureTransactionDao#getAllExpenditureTransactions()
102:             */
103:            public Iterator getAllExpenditureTransactions() {
104:                LOG.debug("getAllExpenditureTransactions() started");
105:
106:                Criteria crit = new Criteria();
107:                // We want them all so no criteria is added
108:
109:                QueryByCriteria qbc = QueryFactory.newQuery(
110:                        ExpenditureTransaction.class, crit);
111:                return getPersistenceBrokerTemplate().getIteratorByQuery(qbc);
112:            }
113:
114:            /**
115:             * Deletes the given expenditure transaction
116:             * 
117:             * @param et the expenditure transaction that will be removed, as such, from the database
118:             * @see org.kuali.module.gl.dao.ExpenditureTransactionDao#delete(org.kuali.module.gl.bo.ExpenditureTransaction)
119:             */
120:            public void delete(ExpenditureTransaction et) {
121:                LOG.debug("delete() started");
122:
123:                getPersistenceBrokerTemplate().delete(et);
124:            }
125:
126:            /**
127:             * Saves an expenditure transaction
128:             * @param et the expenditure transaction to save
129:             * @see org.kuali.module.gl.dao.ExpenditureTransactionDao#save(org.kuali.module.gl.bo.ExpenditureTransaction)
130:             */
131:            public void save(ExpenditureTransaction et) {
132:                LOG.debug("save() started");
133:
134:                getPersistenceBrokerTemplate().store(et);
135:            }
136:
137:            /**
138:             * Since expenditure transactions are temporary, just like flies that live for a mere day, this method removes all of the currently existing
139:             * expenditure transactions from the database, all expenditure transactions having run through the poster and fulfilled their lifecycle
140:             * @see org.kuali.module.gl.dao.ExpenditureTransactionDao#deleteAllExpenditureTransactions()
141:             */
142:            public void deleteAllExpenditureTransactions() {
143:                LOG.debug("deleteAllExpenditureTransactions() started");
144:                Iterator<ExpenditureTransaction> i = getAllExpenditureTransactions();
145:                while (i.hasNext()) {
146:                    ExpenditureTransaction et = i.next();
147:                    if (LOG.isInfoEnabled()) {
148:                        LOG
149:                                .info("The following ExpenditureTransaction was deleted: "
150:                                        + et.toString());
151:                    }
152:                    delete(et);
153:                }
154:            }
155:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.