Source Code Cross Referenced for DbQueryMode.java in  » Development » jodd » jodd » db » 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 » Development » jodd » jodd.db 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
002:
003:        package jodd.db;
004:
005:        import jodd.util.ObjectUtil;
006:        import jodd.util.HashCodeUtil;
007:
008:        import java.sql.ResultSet;
009:
010:        /**
011:         * {@link DbQuery} mode.
012:         */
013:        public class DbQueryMode {
014:
015:            public DbQueryMode() {
016:                type = TYPE_FORWARD_ONLY;
017:                concurrencyType = CONCUR_READ_ONLY;
018:                holdability = CLOSE_CURSORS_AT_COMMIT;
019:                debug = false;
020:            }
021:
022:            // ---------------------------------------------------------------- types
023:
024:            /**
025:             * @see java.sql.ResultSet#TYPE_FORWARD_ONLY
026:             */
027:            public static final int TYPE_FORWARD_ONLY = ResultSet.TYPE_FORWARD_ONLY;
028:            /**
029:             * @see java.sql.ResultSet#TYPE_SCROLL_SENSITIVE
030:             */
031:            public static final int TYPE_SCROLL_SENSITIVE = ResultSet.TYPE_SCROLL_SENSITIVE;
032:            /**
033:             * @see java.sql.ResultSet#TYPE_SCROLL_INSENSITIVE
034:             */
035:            public static final int TYPE_SCROLL_INSENSITIVE = ResultSet.TYPE_SCROLL_INSENSITIVE;
036:
037:            private int type;
038:
039:            public int getType() {
040:                return type;
041:            }
042:
043:            public DbQueryMode setType(int type) {
044:                this .type = type;
045:                return this ;
046:            }
047:
048:            public DbQueryMode typeForwardOnly() {
049:                this .type = TYPE_FORWARD_ONLY;
050:                return this ;
051:            }
052:
053:            public DbQueryMode typeScrollSensitive() {
054:                this .type = TYPE_SCROLL_SENSITIVE;
055:                return this ;
056:            }
057:
058:            public DbQueryMode typeScrollInsensitive() {
059:                this .type = TYPE_SCROLL_SENSITIVE;
060:                return this ;
061:            }
062:
063:            // ---------------------------------------------------------------- concurrency
064:
065:            /**
066:             * @see java.sql.ResultSet#CONCUR_READ_ONLY
067:             */
068:            public static final int CONCUR_READ_ONLY = ResultSet.CONCUR_READ_ONLY;
069:            /**
070:             * @see java.sql.ResultSet#CONCUR_UPDATABLE
071:             */
072:            public static final int CONCUR_UPDATABLE = ResultSet.CONCUR_UPDATABLE;
073:
074:            private int concurrencyType;
075:
076:            public int getConcurrencyType() {
077:                return concurrencyType;
078:            }
079:
080:            public DbQueryMode setConcurrencyType(int concurrencyType) {
081:                this .concurrencyType = concurrencyType;
082:                return this ;
083:            }
084:
085:            public DbQueryMode concurReadOnly() {
086:                this .concurrencyType = CONCUR_READ_ONLY;
087:                return this ;
088:            }
089:
090:            public DbQueryMode concurUpdatable() {
091:                this .concurrencyType = CONCUR_UPDATABLE;
092:                return this ;
093:            }
094:
095:            // ---------------------------------------------------------------- holdability
096:
097:            /**
098:             * @see java.sql.ResultSet#CLOSE_CURSORS_AT_COMMIT
099:             */
100:            public static final int CLOSE_CURSORS_AT_COMMIT = ResultSet.CLOSE_CURSORS_AT_COMMIT;
101:
102:            /**
103:             * @see java.sql.ResultSet#HOLD_CURSORS_OVER_COMMIT
104:             */
105:            public static final int HOLD_CURSORS_OVER_COMMIT = ResultSet.HOLD_CURSORS_OVER_COMMIT;
106:
107:            private int holdability;
108:
109:            public int getHoldability() {
110:                return holdability;
111:            }
112:
113:            public DbQueryMode setHoldability(int holdability) {
114:                this .holdability = holdability;
115:                return this ;
116:            }
117:
118:            public DbQueryMode holdCursorsOverCommit() {
119:                this .holdability = HOLD_CURSORS_OVER_COMMIT;
120:                return this ;
121:            }
122:
123:            public DbQueryMode closeCursorsAtCommit() {
124:                this .holdability = CLOSE_CURSORS_AT_COMMIT;
125:                return this ;
126:            }
127:
128:            // ---------------------------------------------------------------- debug mode
129:
130:            private boolean debug;
131:
132:            public boolean isDebug() {
133:                return debug;
134:            }
135:
136:            public DbQueryMode setDebug(boolean debug) {
137:                this .debug = debug;
138:                return this ;
139:            }
140:
141:            public DbQueryMode debug() {
142:                this .debug = true;
143:                return this ;
144:            }
145:
146:            // ---------------------------------------------------------------- equals & hashCode
147:
148:            @Override
149:            public boolean equals(Object object) {
150:                if (this  == object) {
151:                    return true;
152:                }
153:                if (ObjectUtil.equalsType(object, this ) == false) {
154:                    return false;
155:                }
156:                final DbQueryMode mode = (DbQueryMode) object;
157:
158:                return (mode.getType() == this .type)
159:                        && (mode.getConcurrencyType() == this .concurrencyType)
160:                        && (mode.getHoldability() == this .holdability)
161:                        && (mode.isDebug() == this .debug);
162:            }
163:
164:            @Override
165:            public int hashCode() {
166:                int result = HashCodeUtil.SEED;
167:                result = HashCodeUtil.hash(result, this.type);
168:                result = HashCodeUtil.hash(result, this.concurrencyType);
169:                result = HashCodeUtil.hash(result, this.holdability);
170:                result = HashCodeUtil.hash(result, this.debug);
171:                return result;
172:            }
173:
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.