Source Code Cross Referenced for RequestScope.java in  » Database-ORM » iBATIS » com » ibatis » sqlmap » engine » scope » 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 » Database ORM » iBATIS » com.ibatis.sqlmap.engine.scope 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Copyright 2004 Clinton Begin
003:         *
004:         *  Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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 com.ibatis.sqlmap.engine.scope;
017:
018:        import com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap;
019:        import com.ibatis.sqlmap.engine.mapping.result.ResultMap;
020:        import com.ibatis.sqlmap.engine.mapping.sql.Sql;
021:        import com.ibatis.sqlmap.engine.mapping.statement.MappedStatement;
022:
023:        import java.sql.ResultSet;
024:        import java.util.Map;
025:        import java.util.HashMap;
026:
027:        /**
028:         * Request based implementation of Scope interface
029:         */
030:        public class RequestScope extends BaseScope {
031:            // Used by Any
032:            private SessionScope session;
033:            private ErrorContext errorContext;
034:            private MappedStatement statement;
035:            private ParameterMap parameterMap;
036:            private ResultMap resultMap;
037:            private Sql sql;
038:            // Used by DynamicSql
039:            private ParameterMap dynamicParameterMap;
040:            private String dynamicSql;
041:            // Used by N+1 Select solution
042:            private ResultSet resultSet;
043:            private Map uniqueKeys;
044:            private boolean rowDataFound;
045:            private String currentNestedKey;
046:
047:            /**
048:             * Default constructor
049:             */
050:            public RequestScope() {
051:                errorContext = new ErrorContext();
052:                reset();
053:            }
054:
055:            /**
056:             * @return Returns the currentNestedKey.
057:             */
058:            public String getCurrentNestedKey() {
059:                return currentNestedKey;
060:            }
061:
062:            /**
063:             * @param currentNestedKey The currentNestedKey to set.
064:             */
065:            public void setCurrentNestedKey(String currentNestedKey) {
066:                this .currentNestedKey = currentNestedKey;
067:            }
068:
069:            /**
070:             * Get the request's error context
071:             *
072:             * @return - the request's error context
073:             */
074:            public ErrorContext getErrorContext() {
075:                return errorContext;
076:            }
077:
078:            /**
079:             * Get the session of the request
080:             *
081:             * @return - the session
082:             */
083:            public SessionScope getSession() {
084:                return session;
085:            }
086:
087:            /**
088:             * Set the session for the request
089:             *
090:             * @param session - the new session
091:             */
092:            public void setSession(SessionScope session) {
093:                this .session = session;
094:            }
095:
096:            /**
097:             * Get the statement for the request
098:             *
099:             * @return - the statement
100:             */
101:            public MappedStatement getStatement() {
102:                return statement;
103:            }
104:
105:            /**
106:             * Set the statement for the request
107:             *
108:             * @param statement - the statement
109:             */
110:            public void setStatement(MappedStatement statement) {
111:                this .statement = statement;
112:            }
113:
114:            /**
115:             * Get the parameter map for the request
116:             *
117:             * @return - the parameter map
118:             */
119:            public ParameterMap getParameterMap() {
120:                return parameterMap;
121:            }
122:
123:            /**
124:             * Set the parameter map for the request
125:             *
126:             * @param parameterMap - the new parameter map
127:             */
128:            public void setParameterMap(ParameterMap parameterMap) {
129:                this .parameterMap = parameterMap;
130:            }
131:
132:            /**
133:             * Get the result map for the request
134:             *
135:             * @return - the result map
136:             */
137:            public ResultMap getResultMap() {
138:                return resultMap;
139:            }
140:
141:            /**
142:             * Set the result map for the request
143:             *
144:             * @param resultMap - the result map
145:             */
146:            public void setResultMap(ResultMap resultMap) {
147:                this .resultMap = resultMap;
148:            }
149:
150:            /**
151:             * Get the SQL for the request
152:             *
153:             * @return - the sql
154:             */
155:            public Sql getSql() {
156:                return sql;
157:            }
158:
159:            /**
160:             * Set the SQL for the request
161:             *
162:             * @param sql - the sql
163:             */
164:            public void setSql(Sql sql) {
165:                this .sql = sql;
166:            }
167:
168:            /**
169:             * Get the dynamic parameter for the request
170:             *
171:             * @return - the dynamic parameter
172:             */
173:            public ParameterMap getDynamicParameterMap() {
174:                return dynamicParameterMap;
175:            }
176:
177:            /**
178:             * Set the dynamic parameter for the request
179:             *
180:             * @param dynamicParameterMap - the dynamic parameter
181:             */
182:            public void setDynamicParameterMap(ParameterMap dynamicParameterMap) {
183:                this .dynamicParameterMap = dynamicParameterMap;
184:            }
185:
186:            /**
187:             * Get the dynamic SQL for the request
188:             *
189:             * @return - the dynamic SQL
190:             */
191:            public String getDynamicSql() {
192:                return dynamicSql;
193:            }
194:
195:            /**
196:             * Set the dynamic SQL for the request
197:             *
198:             * @param dynamicSql - the dynamic SQL
199:             */
200:            public void setDynamicSql(String dynamicSql) {
201:                this .dynamicSql = dynamicSql;
202:            }
203:
204:            public ResultSet getResultSet() {
205:                return resultSet;
206:            }
207:
208:            public void setResultSet(ResultSet resultSet) {
209:                this .resultSet = resultSet;
210:            }
211:
212:            public Map getUniqueKeys(ResultMap map) {
213:                if (uniqueKeys == null) {
214:                    return null;
215:                }
216:                return (Map) uniqueKeys.get(map);
217:            }
218:
219:            public void setUniqueKeys(ResultMap map, Map keys) {
220:                if (uniqueKeys == null) {
221:                    uniqueKeys = new HashMap();
222:                }
223:                this .uniqueKeys.put(map, keys);
224:            }
225:
226:            public boolean isRowDataFound() {
227:                return rowDataFound;
228:            }
229:
230:            public void setRowDataFound(boolean rowDataFound) {
231:                this .rowDataFound = rowDataFound;
232:            }
233:
234:            public void reset() {
235:                super .reset();
236:                errorContext.reset();
237:                session = null;
238:                statement = null;
239:                parameterMap = null;
240:                resultMap = null;
241:                sql = null;
242:                dynamicParameterMap = null;
243:                dynamicSql = null;
244:                resultSet = null;
245:                uniqueKeys = null;
246:                rowDataFound = true;
247:            }
248:
249:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.