Source Code Cross Referenced for Compatibility.java in  » Database-ORM » openjpa » org » apache » openjpa » conf » 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 » openjpa » org.apache.openjpa.conf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements.  See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership.  The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License.  You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied.  See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.    
018:         */
019:        package org.apache.openjpa.conf;
020:
021:        /**
022:         * Struct encompassing backwards-compatibility options.
023:         */
024:        public class Compatibility {
025:
026:            /**
027:             * If a JPQL statement is not compliant with the JPA specification,
028:             * fail to parse it.
029:             *
030:             * @since 1.1.0
031:             */
032:            public static final int JPQL_STRICT = 0;
033:
034:            /**
035:             * If a JPQL statement is not compliant with the JPA specification,
036:             * warn the first time that statement is parsed.
037:             *
038:             * @since 1.1.0
039:             */
040:            public static final int JPQL_WARN = 1;
041:
042:            /**
043:             * Allow non-compliant extensions of JPQL.
044:             * 
045:             * @since 1.1.0
046:             */
047:            public static final int JPQL_EXTENDED = 2;
048:
049:            private boolean _strictIdValues = false;
050:            private boolean _hollowLookups = true;
051:            private boolean _checkStore = false;
052:            private boolean _copyIds = false;
053:            private boolean _closeOnCommit = true;
054:            private boolean _quotedNumbers = false;
055:            private boolean _nonOptimisticVersionCheck = false;
056:            private int _jpql = JPQL_STRICT;
057:
058:            /**
059:             * Whether to require exact identity value types when creating object
060:             * ids from a class and value. Defaults to false.
061:             */
062:            public boolean getStrictIdentityValues() {
063:                return _strictIdValues;
064:            }
065:
066:            /**
067:             * Whether to require exact identity value types when creating object
068:             * ids from a class and value. Defaults to false.
069:             */
070:            public void setStrictIdentityValues(boolean strictVals) {
071:                _strictIdValues = strictVals;
072:            }
073:
074:            /**
075:             * Whether to interpret quoted numbers in query strings as numbers.
076:             * OpenJPA versions 0.3.1 and prior treated them as numbers; more recent
077:             * versions treat them as strings.
078:             */
079:            public boolean getQuotedNumbersInQueries() {
080:                return _quotedNumbers;
081:            }
082:
083:            /**
084:             * Whether to interpret quoted numbers in query strings as numbers.
085:             * OpenJPA versions 0.3.1 and prior treated them as numbers; more recent
086:             * versions treat them as strings.
087:             */
088:            public void setQuotedNumbersInQueries(boolean quotedNumbers) {
089:                _quotedNumbers = quotedNumbers;
090:            }
091:
092:            /**
093:             * Whether to return hollow instances to broker lookups with a
094:             * <code>validate</code> parameter of false. OpenJPA versions prior to
095:             * 0.4.0 did not return hollow instances without special configuration
096:             * (the <code>ObjectLookupMode</code>). Beginning with 0.4.0, hollow
097:             * objects are the default.
098:             */
099:            public boolean getValidateFalseReturnsHollow() {
100:                return _hollowLookups;
101:            }
102:
103:            /**
104:             * Whether to return hollow instances to broker lookups with a
105:             * <code>validate</code> parameter of false. OpenJPA versions prior to
106:             * 0.4.0 did not return hollow instances without special configuration
107:             * (the <code>ObjectLookupMode</code>). Beginning with 0.4.0, hollow
108:             * objects are the default.
109:             */
110:            public void setValidateFalseReturnsHollow(boolean hollow) {
111:                _hollowLookups = hollow;
112:            }
113:
114:            /**
115:             * Whether to check the datastore for the existence of a nontransactional
116:             * cached object in broker lookups with a <code>validate</code> parameter
117:             * of true. OpenJPA versions prior to 0.4.0 checked the datastore.
118:             */
119:            public boolean getValidateTrueChecksStore() {
120:                return _checkStore;
121:            }
122:
123:            /**
124:             * Whether to check the datastore for the existence of a nontransactional
125:             * cached object in broker lookups with a <code>validate</code> parameter
126:             * of true. OpenJPA versions prior to 0.4.0 checked the datastore.
127:             */
128:            public void setValidateTrueChecksStore(boolean check) {
129:                _checkStore = check;
130:            }
131:
132:            /**
133:             * Whether to copy identity objects before returning them to client code.
134:             * Versions of OpenJPA prior to 0.3.0 always copied identity objects. Also,
135:             * you should configure OpenJPA to copy identity objects if you mutate them
136:             * after use.
137:             */
138:            public boolean getCopyObjectIds() {
139:                return _copyIds;
140:            }
141:
142:            /**
143:             * Whether to copy identity objects before returning them to client code.
144:             * Versions of OpenJPA prior to 0.3.0 always copied identity objects. Also,
145:             * you should configure OpenJPA to copy identity objects if you mutate them
146:             * after use.
147:             */
148:            public void setCopyObjectIds(boolean copy) {
149:                _copyIds = copy;
150:            }
151:
152:            /**
153:             * Whether to close the broker when the managed transaction commits.
154:             * Versions of OpenJPA prior to 0.3.0 did not close the broker.
155:             */
156:            public boolean getCloseOnManagedCommit() {
157:                return _closeOnCommit;
158:            }
159:
160:            /**
161:             * Whether to close the broker when the managed transaction commits.
162:             * Versions of OpenJPA prior to 0.3.0 did not close the broker.
163:             */
164:            public void setCloseOnManagedCommit(boolean close) {
165:                _closeOnCommit = close;
166:            }
167:
168:            /** 
169:             * Whether or not to perform a version check on instances being updated
170:             * in a datastore transaction. Version of OpenJPA prior to 0.4.1 always
171:             * forced a version check.
172:             */
173:            public void setNonOptimisticVersionCheck(
174:                    boolean nonOptimisticVersionCheck) {
175:                _nonOptimisticVersionCheck = nonOptimisticVersionCheck;
176:            }
177:
178:            /** 
179:             * Whether or not to perform a version check on instances being updated
180:             * in a datastore transaction. Version of OpenJPA prior to 0.4.1 always
181:             * forced a version check.
182:             */
183:            public boolean getNonOptimisticVersionCheck() {
184:                return _nonOptimisticVersionCheck;
185:            }
186:
187:            /**
188:             * Whether or not JPQL extensions are allowed. Defaults to
189:             * {@link #JPQL_STRICT}.
190:             *
191:             * @since 1.1.0
192:             * @see #JPQL_WARN
193:             * @see #JPQL_STRICT
194:             * @see #JPQL_EXTENDED
195:             */
196:            public int getJPQL() {
197:                return _jpql;
198:            }
199:
200:            /**
201:             * Whether or not JPQL extensions are allowed. Possible values: "warn",
202:             * "strict", "extended".
203:             *
204:             * @since 1.1.0
205:             * @see #JPQL_WARN
206:             * @see #JPQL_STRICT
207:             * @see #JPQL_EXTENDED
208:             */
209:            public void setJPQL(String jpql) {
210:                if ("warn".equals(jpql))
211:                    _jpql = JPQL_WARN;
212:                else if ("strict".equals(jpql))
213:                    _jpql = JPQL_STRICT;
214:                else if ("extended".equals(jpql))
215:                    _jpql = JPQL_EXTENDED;
216:                else
217:                    throw new IllegalArgumentException(jpql);
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.