Source Code Cross Referenced for SufficientFundBalancesDaoOjb.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 2006-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.Collection;
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.kfs.KFSPropertyConstants;
025:        import org.kuali.module.gl.bo.SufficientFundBalances;
026:        import org.kuali.module.gl.dao.SufficientFundBalancesDao;
027:
028:        /**
029:         * An OJB implementation of the SufficientFundBalancesDao
030:         */
031:        public class SufficientFundBalancesDaoOjb extends
032:                PlatformAwareDaoBaseOjb implements  SufficientFundBalancesDao {
033:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
034:                    .getLogger(SufficientFundBalancesDaoOjb.class);
035:
036:            /**
037:             * Builds an OJB primary key query from the given parameters and returns the result
038:             * 
039:             * @param universityFiscalYear the university fiscal year of the sufficient funds balance to return
040:             * @param chartOfAccountsCode the chart of accounts code of the sufficient funds balance to return
041:             * @param accountNumber the account number of the sufficient funds balance to return
042:             * @param financialObjectCode the object code of the sufficient funds balance to return
043:             * @return the qualifying sufficient funds balance record, or null no suitable record can be found
044:             * @see org.kuali.module.gl.dao.SufficientFundBalancesDao#getByPrimaryId(java.lang.Integer, java.lang.String, java.lang.String, java.lang.String)
045:             */
046:            public SufficientFundBalances getByPrimaryId(
047:                    Integer universityFiscalYear, String chartOfAccountsCode,
048:                    String accountNumber, String financialObjectCode) {
049:                LOG.debug("getByPrimaryId() started");
050:
051:                Criteria crit = new Criteria();
052:                crit.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR,
053:                        universityFiscalYear);
054:                crit.addEqualTo(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE,
055:                        chartOfAccountsCode);
056:                crit.addEqualTo(KFSPropertyConstants.ACCOUNT_NUMBER,
057:                        accountNumber);
058:                crit.addEqualTo(KFSPropertyConstants.FINANCIAL_OBJECT_CODE,
059:                        financialObjectCode);
060:
061:                QueryByCriteria qbc = QueryFactory.newQuery(
062:                        SufficientFundBalances.class, crit);
063:                return (SufficientFundBalances) getPersistenceBrokerTemplate()
064:                        .getObjectByQuery(qbc);
065:            }
066:
067:            /**
068:             * Saves a sufficient fund balance record
069:             * @param sfb the sufficient funds balance record to save
070:             * @see org.kuali.module.gl.dao.SufficientFundBalancesDao#save(org.kuali.module.gl.bo.SufficientFundBalances)
071:             */
072:            public void save(SufficientFundBalances sfb) {
073:                LOG.debug("save() started");
074:
075:                getPersistenceBrokerTemplate().store(sfb);
076:            }
077:
078:            /**
079:             * Builds an OJB query based on the parameter values and returns all the sufficient fund balances that match that record
080:             * 
081:             * @param universityFiscalYear the university fiscal year of sufficient fund balances to find
082:             * @param chartOfAccountsCode the chart of accounts code of sufficient fund balances to find
083:             * @param financialObjectCode the object code of sufficient fund balances to find
084:             * @return a Collection of sufficient fund balances, qualified by the parameter values
085:             * @see org.kuali.module.gl.dao.SufficientFundBalancesDao#getByObjectCode(java.lang.Integer, java.lang.String, java.lang.String)
086:             */
087:            public Collection getByObjectCode(Integer universityFiscalYear,
088:                    String chartOfAccountsCode, String financialObjectCode) {
089:                LOG.debug("getByObjectCode() started");
090:
091:                Criteria crit = new Criteria();
092:                crit.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR,
093:                        universityFiscalYear);
094:                crit.addEqualTo(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE,
095:                        chartOfAccountsCode);
096:                crit.addEqualTo(KFSPropertyConstants.FINANCIAL_OBJECT_CODE,
097:                        financialObjectCode);
098:
099:                QueryByCriteria qbc = QueryFactory.newQuery(
100:                        SufficientFundBalances.class, crit);
101:                return getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
102:            }
103:
104:            /**
105:             * Deletes sufficient fund balances associated with a given year, chart, and account number
106:             * 
107:             * @param universityFiscalYear the university fiscal year of sufficient fund balances to delete
108:             * @param chartOfAccountsCode the chart code of sufficient fund balances to delete
109:             * @param accountNumber the account number of sufficient fund balances to delete
110:             * @see org.kuali.module.gl.dao.SufficientFundBalancesDao#deleteByAccountNumber(java.lang.Integer, java.lang.String, java.lang.String)
111:             */
112:            public void deleteByAccountNumber(Integer universityFiscalYear,
113:                    String chartOfAccountsCode, String accountNumber) {
114:                LOG.debug("deleteByAccountNumber() started");
115:
116:                Criteria crit = new Criteria();
117:                crit.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR,
118:                        universityFiscalYear);
119:                crit.addEqualTo(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE,
120:                        chartOfAccountsCode);
121:                crit.addEqualTo(KFSPropertyConstants.ACCOUNT_NUMBER,
122:                        accountNumber);
123:
124:                QueryByCriteria qbc = QueryFactory.newQuery(
125:                        SufficientFundBalances.class, crit);
126:                getPersistenceBrokerTemplate().deleteByQuery(qbc);
127:
128:                // This has to be done because deleteByQuery deletes the rows from the table,
129:                // but it doesn't delete them from the cache. If the cache isn't cleared,
130:                // later on, you could get an Optimistic Lock Exception because OJB thinks rows
131:                // exist when they really don't.
132:                getPersistenceBrokerTemplate().clearCache();
133:            }
134:
135:            /**
136:             * This method should only be used in unit tests. It loads all the gl_sf_balances_t rows in memory into a collection. This won't
137:             * sace for production.
138:             * 
139:             * @return a Collection of all sufficient funds records in the database
140:             */
141:            public Collection testingGetAllEntries() {
142:                LOG.debug("testingGetAllEntries() started");
143:
144:                Criteria criteria = new Criteria();
145:                QueryByCriteria qbc = QueryFactory.newQuery(
146:                        SufficientFundBalances.class, criteria);
147:                qbc.addOrderBy(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR,
148:                        true);
149:                qbc.addOrderBy(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE,
150:                        true);
151:                qbc.addOrderBy(KFSPropertyConstants.ACCOUNT_NUMBER, true);
152:                qbc
153:                        .addOrderBy(KFSPropertyConstants.FINANCIAL_OBJECT_CODE,
154:                                true);
155:
156:                return getPersistenceBrokerTemplate().getCollectionByQuery(qbc);
157:            }
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.