Source Code Cross Referenced for AccountBalanceDaoJdbcBase.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » dao » jdbc » 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.jdbc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 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.jdbc;
017:
018:        import org.kuali.core.dao.jdbc.PlatformAwareDaoBaseJdbc;
019:        import org.kuali.core.dbplatform.RawSQL;
020:        import org.kuali.kfs.service.OptionsService;
021:        import org.kuali.module.financial.service.UniversityDateService;
022:
023:        /**
024:         * A base class to support the JDBC operations done for AccountBalance inquiries
025:         */
026:        @RawSQL
027:        public class AccountBalanceDaoJdbcBase extends PlatformAwareDaoBaseJdbc {
028:            protected OptionsService optionsService;
029:            protected UniversityDateService universityDateService;
030:
031:            public OptionsService getOptionsService() {
032:                return optionsService;
033:            }
034:
035:            public void setOptionsService(OptionsService optionsService) {
036:                this .optionsService = optionsService;
037:            }
038:
039:            public UniversityDateService getUniversityDateService() {
040:                return universityDateService;
041:            }
042:
043:            public void setUniversityDateService(
044:                    UniversityDateService universityDateService) {
045:                this .universityDateService = universityDateService;
046:            }
047:
048:            /**
049:             * Creates a String bounded with parantheses with count number of question marks, like this:
050:             * (?, ?, ?) if count is 3.  Right, for creating the SQL queries
051:             * 
052:             * @param count the count of question marks
053:             * @return the resulting String
054:             */
055:            protected String inString(int count) {
056:                StringBuffer sb = new StringBuffer("(");
057:                for (int i = 0; i < count; i++) {
058:                    sb.append('?');
059:                    if (i < count - 1) {
060:                        sb.append(',');
061:                    }
062:                }
063:                sb.append(')');
064:                return sb.toString();
065:            }
066:
067:            /**
068:             * Removes all cost share entries from the temporary holding table for this unique inquiry
069:             * 
070:             * @param tableName the name of the temporary table to remove cost share entries from
071:             * @param sessionIdColumn the name of the column in the temporary table that holds the unique id of the inquiry
072:             * @param sessionId the unique id of the web session of the inquiring user
073:             */
074:            @RawSQL
075:            protected void purgeCostShareEntries(String tableName,
076:                    String sessionIdColumn, String sessionId) {
077:                getSimpleJdbcTemplate()
078:                        .update(
079:                                "DELETE FROM "
080:                                        + tableName
081:                                        + " WHERE "
082:                                        + sessionIdColumn
083:                                        + " = ? "
084:                                        + " AND EXISTS (SELECT 1 FROM ca_a21_sub_acct_t a "
085:                                        + " WHERE a.fin_coa_cd = "
086:                                        + tableName
087:                                        + ".fin_coa_cd AND a.account_nbr = "
088:                                        + tableName
089:                                        + ".account_nbr AND a.sub_acct_nbr = "
090:                                        + tableName
091:                                        + ".sub_acct_nbr AND a.sub_acct_typ_cd = 'CS')",
092:                                sessionId);
093:            }
094:
095:            /**
096:             * Determines if the currently inquiring user has associated temporary pending entries in the temporary pending entry table
097:             * 
098:             * @param sessionId the unique web id of the inquiring user
099:             * @return true if this inquiring user has temporary pending entries, false otherwise
100:             */
101:            @RawSQL
102:            protected boolean hasEntriesInPendingTable(String sessionId) {
103:                return getSimpleJdbcTemplate()
104:                        .queryForInt(
105:                                "select count(*) as COUNT from gl_pending_entry_mt WHERE sesid = ?",
106:                                sessionId) != 0;
107:            }
108:
109:            /**
110:             * Updates the fiscal year and account numbers of temporary pending entries for display
111:             * 
112:             * @param universityFiscalYear the fiscal year to update all the temporary pending entries of this inquiry to
113:             * @param sessionId the unique web id of the inquiring user
114:             */
115:            @RawSQL
116:            protected void fixPendingEntryDisplay(Integer universityFiscalYear,
117:                    String sessionId) {
118:                getSimpleJdbcTemplate()
119:                        .update(
120:                                "update GL_PENDING_ENTRY_MT set univ_fiscal_yr = ? where SESID = ?",
121:                                universityFiscalYear, sessionId);
122:                getSimpleJdbcTemplate()
123:                        .update(
124:                                "update gl_pending_entry_mt set SUB_ACCT_NBR = '-----' where (SUB_ACCT_NBR is null or SUB_ACCT_NBR = '     ')");
125:            }
126:
127:            /**
128:             * Deletes all entries in the temporary table for the given unique user
129:             * 
130:             * @param tableName the table name to purge data from
131:             * @param sessionIdColumn the name of the unique field on that table
132:             * @param sessionId the unique value of the inquiry; basically, the unique web session id of the inquiring user
133:             */
134:            @RawSQL
135:            protected void clearTempTable(String tableName,
136:                    String sessionIdColumn, String sessionId) {
137:                getSimpleJdbcTemplate().update(
138:                        "DELETE from " + tableName + " WHERE "
139:                                + sessionIdColumn + " = ?", sessionId);
140:            }
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.