KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > exceptions > ValidationException


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.exceptions;
23
24 import java.util.Vector JavaDoc;
25 import java.lang.reflect.*;
26 import oracle.toplink.essentials.mappings.DatabaseMapping;
27 import oracle.toplink.essentials.internal.queryframework.*;
28 import oracle.toplink.essentials.internal.identitymaps.*;
29 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.objects.MetadataAccessibleObject;
30 import oracle.toplink.essentials.queryframework.*;
31 import oracle.toplink.essentials.exceptions.i18n.ExceptionMessageGenerator;
32 import oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl;
33 import oracle.toplink.essentials.internal.sessions.AbstractSession;
34 import oracle.toplink.essentials.descriptors.ClassDescriptor;
35 import oracle.toplink.essentials.sessions.Session;
36
37 /**
38  * <p><b>Purpose</b>: This exception is used if incorrect state or method arguments are detected
39  * in a general TopLink object.
40  */

41 public class ValidationException extends TopLinkException {
42     public static final int LOGIN_BEFORE_ALLOCATING_CLIENT_SESSIONS = 7001;
43     public static final int POOL_NAME_DOES_NOT_EXIST = 7002;
44     public static final int MAX_SIZE_LESS_THAN_MIN_SIZE = 7003;
45     public static final int POOLS_MUST_BE_CONFIGURED_BEFORE_LOGIN = 7004;
46     public static final int JAVA_TYPE_IS_NOT_A_VALID_DATABASE_TYPE = 7008;
47     public static final int MISSING_DESCRIPTOR = 7009;
48     public static final int START_INDEX_OUT_OF_RANGE = 7010;
49     public static final int STOP_INDEX_OUT_OF_RANGE = 7011;
50     public static final int FATAL_ERROR_OCCURRED = 7012;
51     public static final int NO_PROPERTIES_FILE_FOUND = 7013;
52     public static final int CHILD_DESCRIPTORS_DO_NOT_HAVE_IDENTITY_MAP = 7017;
53     public static final int FILE_ERROR = 7018;
54     public static final int INCORRECT_LOGIN_INSTANCE_PROVIDED = 7023;
55     public static final int INVALID_MERGE_POLICY = 7024;
56     public static final int ONLY_FIELDS_ARE_VALID_KEYS_FOR_DATABASE_ROWS = 7025;
57     public static final int SEQUENCE_SETUP_INCORRECTLY = 7027;
58     public static final int WRITE_OBJECT_NOT_ALLOWED_IN_UNIT_OF_WORK = 7028;
59     public static final int CANNOT_SET_READ_POOL_SIZE_AFTER_LOGIN = 7030;
60     public static final int CANNOT_ADD_DESCRIPTORS_TO_SESSION_BROKER = 7031;
61     public static final int NO_SESSION_REGISTERED_FOR_CLASS = 7032;
62     public static final int NO_SESSION_REGISTERED_FOR_NAME = 7033;
63     public static final int CANNOT_ADD_DESCRIPTORS_TO_SESSION = 7034;
64     public static final int CANNOT_LOGIN_TO_A_SESSION = 7035;
65     public static final int CANNOT_LOGOUT_OF_A_SESSION = 7036;
66     public static final int CANNOT_MODIFY_SCHEMA_IN_SESSION = 7037;
67     public static final int LOG_IO_ERROR = 7038;
68     public static final int CANNOT_REMOVE_FROM_READ_ONLY_CLASSES_IN_NESTED_UNIT_OF_WORK = 7039;
69     public static final int CANNOT_MODIFY_READ_ONLY_CLASSES_SET_AFTER_USING_UNIT_OF_WORK = 7040;
70     public static final int INVALID_READ_ONLY_CLASS_STRUCTURE_IN_UNIT_OF_WORK = 7041;
71     public static final int PLATFORM_CLASS_NOT_FOUND = 7042;
72     public static final int NO_TABLES_TO_CREATE = 7043;
73     public static final int ILLEGAL_CONTAINER_CLASS = 7044;
74     public static final int CONTAINER_POLICY_DOES_NOT_USE_KEYS = 7047;
75     public static final int MAP_KEY_NOT_DECLARED_IN_ITEM_CLASS = 7048;
76     public static final int MISSING_MAPPING = 7051;
77     public static final int ILLEGAL_USE_OF_MAP_IN_DIRECTCOLLECTION = 7052;
78     public static final int CANNOT_RELEASE_NON_CLIENTSESSION = 7053;
79     public static final int CANNOT_ACQUIRE_CLIENTSESSION_FROM_SESSION = 7054;
80     public static final int OPTIMISTIC_LOCKING_NOT_SUPPORTED = 7055;
81     public static final int WRONG_OBJECT_REGISTERED = 7056;
82     public static final int KEYS_MUST_MATCH = 7057;
83     public static final int INVALID_CONNECTOR = 7058;
84     public static final int INVALID_DATA_SOURCE_NAME = 7059;
85     public static final int CANNOT_ACQUIRE_DATA_SOURCE = 7060;
86     public static final int JTS_EXCEPTION_RAISED = 7061;
87     public static final int FIELD_LEVEL_LOCKING_NOTSUPPORTED_OUTSIDE_A_UNIT_OF_WORK = 7062;
88     public static final int EJB_CONTAINER_EXCEPTION_RAISED = 7063;
89     public static final int EJB_PRIMARY_KEY_REFLECTION_EXCEPTION = 7064;
90     public static final int EJB_CANNOT_LOAD_REMOTE_CLASS = 7065;
91     public static final int EJB_MUST_BE_IN_TRANSACTION = 7066;
92     public static final int EJB_INVALID_PROJECT_CLASS = 7068;
93     public static final int PROJECT_AMENDMENT_EXCEPTION_OCCURED = 7069;
94     public static final int EJB_TOPLINK_PROPERTIES_NOT_FOUND = 7070;
95     public static final int CANT_HAVE_UNBOUND_IN_OUTPUT_ARGUMENTS = 7071;
96     public static final int EJB_INVALID_PLATFORM_CLASS = 7072;
97     public static final int ORACLE_OBJECT_TYPE_NOT_DEFINED = 7073;
98     public static final int ORACLE_OBJECT_TYPE_NAME_NOT_DEFINED = 7074;
99     public static final int ORACLE_VARRAY_MAXIMIM_SIZE_NOT_DEFINED = 7075;
100     public static final int DESCRIPTOR_MUST_NOT_BE_INITIALIZED = 7076;
101     public static final int EJB_INVALID_FINDER_ON_HOME = 7077;
102     public static final int EJB_NO_SUCH_SESSION_SPECIFIED_IN_PROPERTIES = 7078;
103     public static final int EJB_DESCRIPTOR_NOT_FOUND_IN_SESSION = 7079;
104     public static final int EJB_FINDER_EXCEPTION = 7080;
105     public static final int CANNOT_REGISTER_AGGREGATE_OBJECT_IN_UNIT_OF_WORK = 7081;
106     public static final int MULTIPLE_PROJECTS_SPECIFIED_IN_PROPERTIES = 7082;
107     public static final int NO_PROJECT_SPECIFIED_IN_PROPERTIES = 7083;
108     public final static int INVALID_FILE_TYPE = 7084;
109     public final static int SUB_SESSION_NOT_DEFINED_FOR_BROKER = 7085;
110     public final static int EJB_INVALID_SESSION_TYPE_CLASS = 7086;
111     public final static int EJB_SESSION_TYPE_CLASS_NOT_FOUND = 7087;
112     public final static int CANNOT_CREATE_EXTERNAL_TRANSACTION_CONTROLLER = 7088;
113     public final static int SESSION_AMENDMENT_EXCEPTION_OCCURED = 7089;
114     public final static int SET_LISTENER_CLASSES_EXCEPTION = 7091;
115     public final static int EXISTING_QUERY_TYPE_CONFLICT = 7092;
116     public final static int QUERY_ARGUMENT_TYPE_NOT_FOUND = 7093;
117     public final static int ERROR_IN_SESSION_XML = 7094;
118     public final static int NO_SESSIONS_XML_FOUND = 7095;
119     public final static int CANNOT_COMMIT_UOW_AGAIN = 7096;
120     public static final int OPERATION_NOT_SUPPORTED = 7097;
121     public static final int PROJECT_XML_NOT_FOUND = 7099;
122     public static final int NO_SESSION_FOUND = 7100;
123     public static final int NO_TOPLINK_EJB_JAR_XML_FOUND = 7101;
124     public static final int NULL_CACHE_KEY_FOUND_ON_REMOVAL = 7102;
125     public static final int NULL_UNDERLYING_VALUEHOLDER_VALUE = 7103;
126     public static final int INVALID_SEQUENCING_LOGIN = 7104;
127
128     // Security error codes
129
public static final int INVALID_ENCRYPTION_CLASS = 7105;
130     public static final int ERROR_ENCRYPTING_PASSWORD = 7106;
131     public static final int ERROR_DECRYPTING_PASSWORD = 7107;
132     public static final int NOT_SUPPORTED_FOR_DATASOURCE = 7108;
133     public static final int PROJECT_LOGIN_IS_NULL = 7109;
134
135     // for flashback:
136
public static final int HISTORICAL_SESSION_ONLY_SUPPORTED_ON_ORACLE = 7110;
137     public static final int CANNOT_ACQUIRE_HISTORICAL_SESSION = 7111;
138     public static final int FEATURE_NOT_SUPPORTED_IN_JDK_VERSION = 7112;
139     public static final int PLATFORM_DOES_NOT_SUPPORT_CALL_WITH_RETURNING = 7113;
140     public static final int ISOLATED_DATA_NOT_SUPPORTED_IN_CLIENTSESSIONBROKER = 7114;
141     public static final int CLIENT_SESSION_CANNOT_USE_EXCLUSIVE_CONNECTION = 7115;
142
143     // general validation method's arguments
144
public static final int INVALID_METHOD_ARGUMENTS = 7116;
145
146     // customSQL and stored functiuons
147
public static final int MULTIPLE_CURSORS_NOT_SUPPORTED = 7117;
148     public static final int WRONG_USAGE_OF_SET_CUSTOM_SQL_ARGUMENT_TYPE_METOD = 7118;
149     public static final int CANNOT_TRANSLATE_UNPREPARED_CALL = 7119;
150     public static final int CANNOT_SET_CURSOR_FOR_PARAMETER_TYPE_OTHER_THAN_OUT = 7120;
151     public static final int PLATFORM_DOES_NOT_SUPPORT_STORED_FUNCTIONS = 7121;
152     public static final int EXCLUSIVE_CONNECTION_NO_LONGER_AVAILABLE = 7122;
153
154     // From UnitOfWork writeChanges() feature
155
public static final int UNIT_OF_WORK_IN_TRANSACTION_COMMIT_PENDING = 7123;
156     public static final int UNIT_OF_WORK_AFTER_WRITE_CHANGES_FAILED = 7124;
157     public static final int INACTIVE_UNIT_OF_WORK = 7125;
158     public static final int CANNOT_WRITE_CHANGES_ON_NESTED_UNIT_OF_WORK = 7126;
159     public static final int CANNOT_WRITE_CHANGES_TWICE = 7127;
160     public static final int ALREADY_LOGGED_IN = 7128;
161
162     // general validation method's arguments
163
public static final int INVALID_NULL_METHOD_ARGUMENTS = 7129;
164     public static final int NESTED_UOW_NOT_SUPPORTED_FOR_ATTRIBUTE_TRACKING = 7130;
165     public static final int WRONG_COLLECTION_CHANGE_EVENT_TYPE = 7131;
166     public static final int WRONG_CHANGE_EVENT = 7132;
167     public static final int OLD_COMMIT_NOT_SUPPORTED_FOR_ATTRIBUTE_TRACKING = 7133;
168
169     //ServerPlatform exceptions
170
public static final int SERVER_PLATFORM_IS_READ_ONLY_AFTER_LOGIN = 7134;
171     public static final int CANNOT_COMMIT_AND_RESUME_UOW_WITH_MODIFY_ALL_QUERIES = 7135;
172     public static final int NESTED_UOW_NOT_SUPPORTED_FOR_MODIFY_ALL_QUERY = 7136;
173
174     //fetch group
175
public final static int UNFETCHED_ATTRIBUTE_NOT_EDITABLE = 7137;
176     public final static int OBJECT_NEED_IMPL_TRACKER_FOR_FETCH_GROUP_USAGE = 7138;
177     public static final int MODIFY_ALL_QUERIES_NOT_SUPPORTED_WITH_OTHER_WRITES = 7139;
178
179     // Multiple sequences exceptions
180
public static final int WRONG_SEQUENCE_TYPE = 7140;
181     public static final int CANNOT_SET_DEFAULT_SEQUENCE_AS_DEFAULT = 7141;
182     public static final int DEFAULT_SEQUENCE_NAME_ALREADY_USED_BY_SEQUENCE = 7142;
183     public static final int SEQUENCE_NAME_ALREADY_USED_BY_DEFAULT_SEQUENCE = 7143;
184     public static final int PLATFORM_DOES_NOT_SUPPORT_SEQUENCE = 7144;
185     public static final int SEQUENCE_CANNOT_BE_CONNECTED_TO_TWO_PLATFORMS = 7145;
186     public static final int QUERY_SEQUENCE_DOES_NOT_HAVE_SELECT_QUERY = 7146;
187     public static final int CREATE_PLATFORM_DEFAULT_SEQUENCE_UNDEFINED = 7147;
188     public static final int CANNOT_RESUME_SYNCHRONIZED_UOW = 7148;
189     
190     // EJB annotation processing validation exceptions
191
public static final int INVALID_COMPOSITE_PK_ATTRIBUTE = 7149;
192     public static final int INVALID_COMPOSITE_PK_SPECIFICATION = 7150;
193     public static final int INVALID_TYPE_FOR_ENUMERATED_ATTRIBUTE = 7151;
194     public static final int TABLE_PER_CLASS_INHERITANCE_NOT_SUPPORTED = 7152;
195     public static final int MAPPING_ANNOTATIONS_APPLIED_TO_TRANSIENT_ATTRIBUTE = 7153;
196     public static final int NO_MAPPED_BY_ATTRIBUTE_FOUND = 7154;
197     public static final int INVALID_TYPE_FOR_SERIALIZED_ATTRIBUTE = 7155;
198     public static final int UNABLE_TO_LOAD_CLASS = 7156;
199     public static final int INVALID_COLUMN_ANNOTATION_ON_RELATIONSHIP = 7157;
200     public static final int ERROR_PROCESSING_NAMED_QUERY_ANNOTATION = 7158;
201     public static final int COULD_NOT_FIND_MAP_KEY = 7159;
202     public static final int UNI_DIRECTIONAL_ONE_TO_MANY_HAS_JOINCOLUMN_ANNOTATIONS = 7160;
203     public static final int NO_PK_ANNOTATIONS_FOUND = 7161;
204     public static final int MULTIPLE_EMBEDDED_ID_ANNOTATIONS_FOUND = 7162;
205     public static final int EMBEDDED_ID_AND_ID_ANNOTATIONS_FOUND = 7163;
206     public static final int INVALID_TYPE_FOR_LOB_ATTRIBUTE = 7164;
207     public static final int INVALID_TYPE_FOR_TEMPORAL_ATTRIBUTE = 7165;
208     public static final int TABLE_GENERATOR_RESERVED_NAME = 7166;
209     public static final int SEQUENCE_GENERATOR_RESERVED_NAME = 7167;
210     public static final int INVALID_TYPE_FOR_VERSION_ATTRIBUTE = 7168;
211     public static final int ONLY_ONE_GENERATED_VALURE_IS_ALLOWED = 7169;
212     public static final int ERROR_INSTANTIATING_ENTITY_LISTENER = 7172;
213
214     // Change Tracking
215
public static final int WRONG_PROPERTY_NAME_IN_CHANGE_EVENT = 7173;
216     
217     // Added for BUG 4349991
218
public static final int NO_CORRESPONDING_SETTER_METHOD_DEFINED = 7174;
219     
220     // Added for Cascaded Optimistic Locking support
221
public static final int UNSUPPORTED_CASCADE_LOCKING_MAPPING = 7175;
222     public static final int UNSUPPORTED_CASCADE_LOCKING_MAPPING_WITH_CUSTOM_QUERY = 7176;
223     public static final int UNSUPPORTED_CASCADE_LOCKING_DESCRIPTOR = 7177;
224
225     // Added for Proxy Authentication
226
public static final int ORACLEOCIPROXYCONNECTOR_REQUIRES_ORACLEOCICONNECTIONPOOL = 7178;
227     public static final int ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_ORACLECONNECTION = 7179;
228     public static final int ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_ORACLECONNECTION_VERSION = 7180;
229     public static final int ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_INT_PROXYTYPE = 7181;
230
231     // EJB 3.0
232
public static final int COULD_NOT_FIND_DRIVER_CLASS = 7182;
233     public static final int ERROR_CLOSING_PERSISTENCE_XML = 7183;
234     public static final int CONFIG_FACTORY_NAME_PROPERTY_NOT_SPECIFIED = 7184;
235     public static final int CONFIG_FACTORY_NAME_PROPERTY_NOT_FOUND = 7185;
236     public static final int CANNOT_INVOKE_METHOD_ON_CONFIG_CLASS = 7186;
237     public static final int CONFIG_METHOD_NOT_DEFINED = 7187;
238     public static final int CLASS_LIST_MUST_NOT_BE_NULL = 7188;
239     public static final int CURRENT_LOADER_NOT_VALID = 7189;
240     public static final int METHOD_FAILED = 7190;
241     public static final int ENTITY_CLASS_NOT_FOUND = 7191;
242     public static final int CLASS_FILE_TRANSFORMER_THROWS_EXCEPTION = 7192;
243     public static final int JAR_FILES_IN_PERSISTENCE_XML_NOT_SUPPORTED = 7193;
244     public static final int COULD_NOT_BIND_JNDI = 7194;
245     public static final int EXCEPTION_CONFIGURING_EM_FACTORY = 7195;
246     public static final int CANNOT_CAST_TO_CLASS = 7196;
247     public static final int NOT_SUPPORTED = 7197;
248     public static final int CLASS_NOT_FOUND_WHILE_CONVERTING_CLASSNAMES = 7198;
249     public static final int PRIMARY_TABLE_NOT_DEFINED_FOR_RELATIONSHIP = 7199;
250     public static final int INVALID_EMBEDDABLE_ATTRIBUTE = 7200;
251     public static final int INVALID_ENTITY_MAPPINGS_DOCUMENT = 7201;
252     public static final int INVALID_ATTRIBUTE_OVERRIDE_NAME = 7202;
253     public static final int INVALID_COLLECTION_TYPE_FOR_RELATIONSHIP = 7203;
254     public static final int MULTIPLE_EMBEDDED_ID_ELEMENTS_FOUND = 7205;
255     public static final int EMBEDDED_ID_AND_ID_ELEMENTS_FOUND = 7206;
256     public static final int INVALID_CLASS_TYPE_FOR_BLOB_ATTRIBUTE = 7207;
257     public static final int INVALID_CLASS_TYPE_FOR_CLOB_ATTRIBUTE = 7208;
258     public static final int UNI_DIRECTIONAL_ONE_TO_MANY_HAS_JOINCOLUMN_ELEMENTS = 7209;
259     public static final int ERROR_PROCESSING_NAMED_QUERY_ELEMENT = 7210;
260     public static final int INVALID_COLUMN_ELEMENT_ON_RELATIONSHIP = 7211;
261     public static final int TARGET_ENTITY_CANNOT_BE_DETERMINED = 7212;
262     public static final int NO_TEMPORAL_TYPE_SPECIFIED = 7214;
263     public static final int UNABLE_TO_DETERMINE_CLASS_FOR_FIELD = 7215;
264     public static final int UNABLE_TO_DETERMINE_CLASS_FOR_PROPERTY = 7216;
265     public static final int INVALID_ORDER_BY_VALUE = 7217;
266     public static final int PLATFORM_DOES_NOT_OVERRIDE_GETCREATETEMPTABLESQLPREFIX = 7218;
267     public static final int MAPPING_DOES_NOT_OVERRIDE_VALUEFROMROWINTERNALWITHJOIN = 7219;
268     
269     // EJB 3.0 JoinColumn(s) and PrimaryKeyJoinColumn(s) validation
270
public static final int INCOMPLETE_JOIN_COLUMNS_SPECIFIED = 7220;
271     public static final int EXCESSIVE_JOIN_COLUMNS_SPECIFIED = 7221;
272     public static final int INCOMPLETE_PRIMARY_KEY_JOIN_COLUMNS_SPECIFIED = 7222;
273     public static final int EXCESSIVE_PRIMARY_KEY_JOIN_COLUMNS_SPECIFIED = 7223;
274     
275     // EJB 3.0 Callback validation
276
public static final int INVALID_CALLBACK_METHOD = 7224;
277     public static final int INVALID_CALLBACK_METHOD_NAME = 7225;
278     public static final int INVALID_CALLBACK_METHOD_MODIFIER = 7226;
279     public static final int MULTIPLE_CALLBACK_METHODS_DEFINED = 7227;
280     public static final int INVALID_ENTITY_CALLBACK_METHOD_ARGUMENTS = 7228;
281     public static final int INVALID_ENTITY_LISTENER_CALLBACK_METHOD_ARGUMENTS = 7229;
282
283     public static final int PERSISTENCE_UNIT_METADATA_CONFLICT = 7230;
284     public static final int CANNOT_PERSIST_MANAGED_OBJECT = 7231;
285     public static final int UNSPECIFIED_COMPOSITE_PK_NOT_SUPPORTED = 7232;
286
287     public static final int INCOMPLETE_JOIN_COLUMN_ELEMENTS_SPECIFIED = 7233;
288     public static final int EXCESSIVE_JOIN_COLUMN_ELEMENTS_SPECIFIED = 7234;
289     public static final int INCOMPLETE_PK_JOIN_COLUMN_ELEMENTS_SPECIFIED = 7235;
290     public static final int EXCESSIVE_PK_JOIN_COLUMN_ELEMENTS_SPECIFIED = 7236;
291
292     public static final int NON_UNIQUE_ENTITY_NAME = 7237;
293     
294     public static final int CONFLICTING_SEQUENCE_AND_TABLE_GENERATORS_SPECIFIED = 7238;
295     public static final int CONFLICTING_SEQUENCE_GENERATORS_SPECIFIED = 7239;
296     public static final int CONFLICTING_SEQUENCE_NAME_AND_TABLE_PK_COLUMN_VALUE_SPECIFIED = 7240;
297     public static final int CONFLICTING_TABLE_GENERATORS_SPECIFIED = 7241;
298     public static final int INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION = 7242;
299
300     public static final int CLASS_NOT_LISTED_IN_PERSISTENCE_UNIT = 7243;
301
302     public static final int INVALID_MAPPING = 7244;
303     public static final int CONFLICTNG_ACCESS_TYPE_FOR_EMBEDDABLE = 7245;
304     public static final int INVALID_EMBEDDED_ATTRIBUTE = 7246;
305     public static final int BOTH_FIELDS_AND_PROPERTIES_ANNOTATED = 7247;
306     public static final int INCORRECT_OVERRIDING_OF_ACCESSTYPE = 7248;
307
308     /**
309      * INTERNAL:
310      * TopLink exceptions should only be thrown by TopLink.
311      */

312     public ValidationException() {
313         super();
314     }
315
316     /**
317      * INTERNAL:
318      * TopLink exceptions should only be thrown by TopLink.
319      */

320     protected ValidationException(String JavaDoc theMessage) {
321         super(theMessage);
322     }
323
324     /**
325      * INTERNAL:
326      * TopLink exceptions should only be thrown by TopLink.
327      */

328     protected ValidationException(String JavaDoc message, Exception JavaDoc internalException) {
329         super(message, internalException);
330     }
331     
332     public static ValidationException alreadyLoggedIn(String JavaDoc sessionName) {
333         Object JavaDoc[] args = { sessionName };
334         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ALREADY_LOGGED_IN, args));
335         validationException.setErrorCode(ALREADY_LOGGED_IN);
336         return validationException;
337     }
338     
339     public static ValidationException cannotAcquireClientSessionFromSession() {
340         Object JavaDoc[] args = { };
341
342         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_ACQUIRE_CLIENTSESSION_FROM_SESSION, args));
343         validationException.setErrorCode(CANNOT_ACQUIRE_CLIENTSESSION_FROM_SESSION);
344         return validationException;
345     }
346
347     public static ValidationException cannotAcquireDataSource(Object JavaDoc name, Exception JavaDoc exception) {
348         Object JavaDoc[] args = { name };
349
350         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_ACQUIRE_DATA_SOURCE, args), exception);
351         validationException.setErrorCode(CANNOT_ACQUIRE_DATA_SOURCE);
352         return validationException;
353     }
354     
355     // The following is for flashback.
356
public static ValidationException cannotAcquireHistoricalSession() {
357         Object JavaDoc[] args = { };
358
359         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_ACQUIRE_HISTORICAL_SESSION, args));
360         validationException.setErrorCode(CANNOT_ACQUIRE_HISTORICAL_SESSION);
361         return validationException;
362     }
363     
364     public static ValidationException cannotAddDescriptorsToSessionBroker() {
365         Object JavaDoc[] args = { };
366
367         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_ADD_DESCRIPTORS_TO_SESSION_BROKER, args));
368         validationException.setErrorCode(CANNOT_ADD_DESCRIPTORS_TO_SESSION_BROKER);
369         return validationException;
370     }
371     
372     public static ValidationException cannotCastToClass(Object JavaDoc ob, Class JavaDoc objectClass, Class JavaDoc castClass) {
373         Object JavaDoc[] args = { ob, objectClass, castClass };
374         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_CAST_TO_CLASS, args));
375         validationException.setErrorCode(CANNOT_CAST_TO_CLASS);
376         return validationException;
377     }
378     
379     public static ValidationException cannotCommitAndResumeSynchronizedUOW(UnitOfWorkImpl uow) {
380         Object JavaDoc[] args = { };
381
382         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_RESUME_SYNCHRONIZED_UOW, args));
383         validationException.setErrorCode(CANNOT_RESUME_SYNCHRONIZED_UOW);
384         validationException.setSession(uow);
385         return validationException;
386     }
387     
388     public static ValidationException cannotCommitAndResumeUOWWithModifyAllQueries() {
389         Object JavaDoc[] args = { };
390
391         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_COMMIT_AND_RESUME_UOW_WITH_MODIFY_ALL_QUERIES, args));
392         validationException.setErrorCode(CANNOT_COMMIT_AND_RESUME_UOW_WITH_MODIFY_ALL_QUERIES);
393         return validationException;
394     }
395     
396     public static ValidationException cannotCommitUOWAgain() {
397         Object JavaDoc[] args = { };
398
399         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_COMMIT_UOW_AGAIN, args));
400         validationException.setErrorCode(CANNOT_COMMIT_UOW_AGAIN);
401         return validationException;
402     }
403     
404     public static ValidationException cannotCreateExternalTransactionController(String JavaDoc externalTransactionControllerName) {
405         Object JavaDoc[] args = { externalTransactionControllerName };
406
407         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_CREATE_EXTERNAL_TRANSACTION_CONTROLLER, args));
408         validationException.setErrorCode(CANNOT_CREATE_EXTERNAL_TRANSACTION_CONTROLLER);
409         return validationException;
410     }
411     
412     public static ValidationException notSupportedForDatasource() {
413         Object JavaDoc[] args = { };
414
415         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NOT_SUPPORTED_FOR_DATASOURCE, args));
416         validationException.setErrorCode(NOT_SUPPORTED_FOR_DATASOURCE);
417         return validationException;
418     }
419
420     public static ValidationException notSupported(String JavaDoc operation, Class JavaDoc theClass) {
421         Object JavaDoc[] args = { operation, theClass };
422
423         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NOT_SUPPORTED, args));
424         validationException.setErrorCode(NOT_SUPPORTED);
425         return validationException;
426     }
427
428     public static ValidationException cannotSetListenerClasses(Exception JavaDoc exception) {
429         Object JavaDoc[] args = { };
430
431         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SET_LISTENER_CLASSES_EXCEPTION, args), exception);
432         validationException.setErrorCode(SET_LISTENER_CLASSES_EXCEPTION);
433         return validationException;
434     }
435
436     public static ValidationException cannotHaveUnboundInOutputArguments() {
437         Object JavaDoc[] args = { };
438
439         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANT_HAVE_UNBOUND_IN_OUTPUT_ARGUMENTS, args));
440         validationException.setErrorCode(CANT_HAVE_UNBOUND_IN_OUTPUT_ARGUMENTS);
441         return validationException;
442     }
443
444     public static ValidationException cannotModifyReadOnlyClassesSetAfterUsingUnitOfWork() {
445         Object JavaDoc[] args = { CR };
446
447         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_MODIFY_READ_ONLY_CLASSES_SET_AFTER_USING_UNIT_OF_WORK, args));
448         validationException.setErrorCode(CANNOT_MODIFY_READ_ONLY_CLASSES_SET_AFTER_USING_UNIT_OF_WORK);
449         return validationException;
450     }
451
452     public static ValidationException cannotRegisterAggregateObjectInUnitOfWork(Class JavaDoc type) {
453         Object JavaDoc[] args = { type };
454
455         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_REGISTER_AGGREGATE_OBJECT_IN_UNIT_OF_WORK, args));
456         validationException.setErrorCode(CANNOT_REGISTER_AGGREGATE_OBJECT_IN_UNIT_OF_WORK);
457         return validationException;
458     }
459
460     public static ValidationException cannotReleaseNonClientSession() {
461         Object JavaDoc[] args = { };
462
463         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_RELEASE_NON_CLIENTSESSION, args));
464         validationException.setErrorCode(CANNOT_RELEASE_NON_CLIENTSESSION);
465         return validationException;
466     }
467
468     public static ValidationException cannotRemoveFromReadOnlyClassesInNestedUnitOfWork() {
469         Object JavaDoc[] args = { CR };
470
471         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_REMOVE_FROM_READ_ONLY_CLASSES_IN_NESTED_UNIT_OF_WORK, args));
472         validationException.setErrorCode(CANNOT_REMOVE_FROM_READ_ONLY_CLASSES_IN_NESTED_UNIT_OF_WORK);
473         return validationException;
474     }
475
476     public static ValidationException cannotSetReadPoolSizeAfterLogin() {
477         Object JavaDoc[] args = { };
478
479         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_SET_READ_POOL_SIZE_AFTER_LOGIN, args));
480         validationException.setErrorCode(CANNOT_SET_READ_POOL_SIZE_AFTER_LOGIN);
481         return validationException;
482     }
483
484     public static ValidationException childDescriptorsDoNotHaveIdentityMap() {
485         Object JavaDoc[] args = { };
486
487         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CHILD_DESCRIPTORS_DO_NOT_HAVE_IDENTITY_MAP, args));
488         validationException.setErrorCode(CHILD_DESCRIPTORS_DO_NOT_HAVE_IDENTITY_MAP);
489         return validationException;
490     }
491
492     public static ValidationException clientSessionCanNotUseExclusiveConnection() {
493         Object JavaDoc[] args = { };
494         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CLIENT_SESSION_CANNOT_USE_EXCLUSIVE_CONNECTION, args));
495         validationException.setErrorCode(CLIENT_SESSION_CANNOT_USE_EXCLUSIVE_CONNECTION);
496         return validationException;
497     }
498
499     public static ValidationException containerPolicyDoesNotUseKeys(ContainerPolicy aPolicy, String JavaDoc methodName) {
500         Object JavaDoc[] args = { aPolicy.getContainerClass().toString(), methodName };
501
502         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONTAINER_POLICY_DOES_NOT_USE_KEYS, args));
503         validationException.setErrorCode(CONTAINER_POLICY_DOES_NOT_USE_KEYS);
504         return validationException;
505     }
506
507     public static ValidationException descriptorMustBeNotInitialized(ClassDescriptor descriptor) {
508         Object JavaDoc[] args = { descriptor, CR };
509
510         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, DESCRIPTOR_MUST_NOT_BE_INITIALIZED, args));
511         validationException.setErrorCode(DESCRIPTOR_MUST_NOT_BE_INITIALIZED);
512         return validationException;
513     }
514
515
516     public static ValidationException nonUniqueEntityName(String JavaDoc clsName1, String JavaDoc clsName2, String JavaDoc name) {
517         Object JavaDoc[] args = { name, clsName1, clsName2, CR };
518
519         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NON_UNIQUE_ENTITY_NAME, args));
520         validationException.setErrorCode(NON_UNIQUE_ENTITY_NAME);
521         return validationException;
522     }
523
524     public static ValidationException ejbCannotLoadRemoteClass(Exception JavaDoc exception, Class JavaDoc beanClass, String JavaDoc remoteClass) {
525         Object JavaDoc[] args = { beanClass, remoteClass, CR };
526
527         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_CANNOT_LOAD_REMOTE_CLASS, args), exception);
528         validationException.setErrorCode(EJB_CANNOT_LOAD_REMOTE_CLASS);
529         return validationException;
530     }
531
532     public static ValidationException ejbContainerExceptionRaised(Exception JavaDoc exception) {
533         Object JavaDoc[] args = { };
534
535         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_CONTAINER_EXCEPTION_RAISED, args), exception);
536         validationException.setErrorCode(EJB_CONTAINER_EXCEPTION_RAISED);
537         return validationException;
538     }
539
540     /**
541     * PUBLIC:
542     * Possible cause: The descriptor listed was not found in the session specified on the deployment descriptor.
543     * Action: Check that the project specified in the TopLink.properties file is the desired project.
544     */

545     public static ValidationException ejbDescriptorNotFoundInSession(Class JavaDoc beanClass, String JavaDoc sessionName) {
546         Object JavaDoc[] args = { beanClass.getName(), sessionName };
547
548         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_DESCRIPTOR_NOT_FOUND_IN_SESSION, args));
549         validationException.setErrorCode(EJB_DESCRIPTOR_NOT_FOUND_IN_SESSION);
550         return validationException;
551     }
552
553     public static ValidationException ejbFinderException(Object JavaDoc bean, Throwable JavaDoc finderException, Vector JavaDoc primaryKey) {
554         Object JavaDoc[] args = { bean, bean.getClass(), primaryKey };
555
556         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_FINDER_EXCEPTION, args));
557         validationException.setErrorCode(EJB_FINDER_EXCEPTION);
558         return validationException;
559     }
560
561     public static ValidationException ejbInvalidHomeInterfaceClass(Class JavaDoc homeClassName) {
562         Object JavaDoc[] args = { homeClassName.toString() };
563
564         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_INVALID_FINDER_ON_HOME, args));
565         validationException.setErrorCode(EJB_INVALID_FINDER_ON_HOME);
566         return validationException;
567     }
568
569     public static ValidationException ejbInvalidPlatformClass(String JavaDoc platformName, String JavaDoc projectName) {
570         Object JavaDoc[] args = { platformName, projectName };
571
572         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_INVALID_PLATFORM_CLASS, args));
573         validationException.setErrorCode(EJB_INVALID_PLATFORM_CLASS);
574         return validationException;
575     }
576
577     /**
578     * PUBLIC:
579     * Possible cause: The project class specified in the TopLink.properties file for the session specified on the toplink_session_name environment variable can not be found.
580     * Action: Check that the project class given in the exception is on the WebSphere dependent classpath.
581     */

582     public static ValidationException ejbInvalidProjectClass(String JavaDoc projectClassName, String JavaDoc projectName, Throwable JavaDoc aThrowable) {
583         Object JavaDoc[] args = { projectClassName, projectName };
584
585         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_INVALID_PROJECT_CLASS, args));
586         validationException.setInternalException(aThrowable);
587         validationException.setErrorCode(EJB_INVALID_PROJECT_CLASS);
588         return validationException;
589     }
590
591     /**
592     * PUBLIC:
593     * Possible cause: The session type specified in the TopLink.properties file for the session specified on the toplink_session_name environment variable is not a valid type.
594     * Action: Check the session type must be either DatabaseSession or it's subclasses type (including the user-defined session type, which must be extended from DatabaseSession).
595     */

596     public static ValidationException ejbInvalidSessionTypeClass(String JavaDoc sessionType, String JavaDoc sessionName) {
597         Object JavaDoc[] args = { sessionType, sessionName };
598
599         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_INVALID_SESSION_TYPE_CLASS, args));
600         validationException.setErrorCode(EJB_INVALID_SESSION_TYPE_CLASS);
601         return validationException;
602     }
603
604     /**
605     * PUBLIC:
606     * Possible cause: An attempt was made to create or remove a been outside of a transaction.
607     * Action: Ensure that all removing and creating of beans is done within a transaction.
608     */

609     public static ValidationException ejbMustBeInTransaction(Object JavaDoc bean) {
610         Object JavaDoc[] args = { bean, CR };
611
612         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_MUST_BE_IN_TRANSACTION, args));
613         validationException.setErrorCode(EJB_MUST_BE_IN_TRANSACTION);
614         return validationException;
615     }
616
617     /**
618     * PUBLIC:
619     * Possible cause: The toplink_session_name value on the beans environment variable does not match with one in the TopLink.properties file.
620     * Action: Check that the session is in the properties file and check for any possible spelling differences. If necessary, correct the value of toplink_sessoin_name, regenerate thedeployment code, and redeploy.
621     */

622     public static ValidationException ejbNoSuchSessionSpecifiedInProperties(String JavaDoc sessionName, Class JavaDoc beanClass) {
623         Object JavaDoc[] args = { sessionName, beanClass };
624
625         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_NO_SUCH_SESSION_SPECIFIED_IN_PROPERTIES, args));
626         validationException.setErrorCode(EJB_NO_SUCH_SESSION_SPECIFIED_IN_PROPERTIES);
627         return validationException;
628     }
629
630     /**
631     * PUBLIC:
632     * Possible cause: An incorrect primary key object is being used with a bean.
633     * Action: Ensure that you are using the correct primary key object for a bean.
634     */

635     public static ValidationException ejbPrimaryKeyReflectionException(Exception JavaDoc exception, Object JavaDoc primaryKey, Object JavaDoc bean) {
636         Object JavaDoc[] args = { primaryKey, bean, CR };
637
638         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_PRIMARY_KEY_REFLECTION_EXCEPTION, args), exception);
639         validationException.setErrorCode(EJB_PRIMARY_KEY_REFLECTION_EXCEPTION);
640         return validationException;
641     }
642
643     /**
644     * PUBLIC:
645     * Possible cause: The session type specified in the TopLink.properties file for the session specified on the toplink_session_name environment variable is not found using the default class loader.
646     * Action: Check that the session class given in the exception is on the app server classpath.
647     */

648     public static ValidationException ejbSessionTypeClassNotFound(String JavaDoc sessionType, String JavaDoc sessionName, Throwable JavaDoc exception) {
649         Object JavaDoc[] args = { sessionType, sessionName };
650
651         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_SESSION_TYPE_CLASS_NOT_FOUND, args));
652         validationException.setErrorCode(EJB_SESSION_TYPE_CLASS_NOT_FOUND);
653         validationException.setInternalException(exception);
654         return validationException;
655     }
656
657     /**
658     * PUBLIC:
659     * Possible cause: The TopLink.properties file can not be found.
660     * Action: Make sure that the location of the TopLink.properties files is on the classpath. If the exception is within VisualAge the TopLink.properties file must be in the project resources for the TopLink project.
661     */

662     public static ValidationException ejbTopLinkPropertiesNotFound(Exception JavaDoc exception) {
663         Object JavaDoc[] args = { };
664
665         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EJB_TOPLINK_PROPERTIES_NOT_FOUND, args));
666         validationException.setInternalException(exception);
667         validationException.setErrorCode(EJB_TOPLINK_PROPERTIES_NOT_FOUND);
668         return validationException;
669     }
670
671     public static ValidationException errorProcessingNamedQueryAnnotation(Class JavaDoc entityClass, String JavaDoc namedQuery, Exception JavaDoc exception) {
672         Object JavaDoc[] args = { entityClass, namedQuery };
673         
674         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ERROR_PROCESSING_NAMED_QUERY_ANNOTATION, args), exception);
675         validationException.setErrorCode(ERROR_PROCESSING_NAMED_QUERY_ANNOTATION);
676         return validationException;
677     }
678     
679     public static ValidationException errorProcessingNamedQueryElement(String JavaDoc namedQuery, Exception JavaDoc exception) {
680         Object JavaDoc[] args = { namedQuery };
681         
682         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ERROR_PROCESSING_NAMED_QUERY_ELEMENT, args), exception);
683         validationException.setErrorCode(ERROR_PROCESSING_NAMED_QUERY_ELEMENT);
684         return validationException;
685     }
686     
687     /**
688      * PUBLIC:
689      * The session named "name" could not be found in the Sessions.XML
690      */

691     public static ValidationException errorInSessionsXML(String JavaDoc translatedExceptions) {
692         ValidationException validationException = new ValidationException(translatedExceptions);
693         validationException.setErrorCode(ERROR_IN_SESSION_XML);
694         return validationException;
695     }
696
697     public static ValidationException errorInstantiatingEntityListener(Class JavaDoc entityListener, Exception JavaDoc exception) {
698         Object JavaDoc[] args = { entityListener };
699         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ERROR_INSTANTIATING_ENTITY_LISTENER, args), exception);
700         validationException.setErrorCode(ERROR_INSTANTIATING_ENTITY_LISTENER);
701         return validationException;
702     }
703
704     public static ValidationException noPropertiesFileFound(Exception JavaDoc exception) {
705         Object JavaDoc[] args = { };
706         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_PROPERTIES_FILE_FOUND, args), exception);
707         validationException.setErrorCode(NO_PROPERTIES_FILE_FOUND);
708         return validationException;
709     }
710
711     public static ValidationException noSessionsXMLFound(String JavaDoc resourceName) {
712         Object JavaDoc[] args = { resourceName };
713         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_SESSIONS_XML_FOUND, args));
714         validationException.setErrorCode(NO_SESSIONS_XML_FOUND);
715         return validationException;
716     }
717
718     public static ValidationException errorEncryptingPassword(Exception JavaDoc exception) {
719         Object JavaDoc[] args = { };
720         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ERROR_ENCRYPTING_PASSWORD, args), exception);
721         validationException.setErrorCode(ERROR_ENCRYPTING_PASSWORD);
722         return validationException;
723     }
724
725     public static ValidationException embeddedIdAndIdAnnotationFound(Class JavaDoc entityClass, String JavaDoc embeddedIdAttributeName, String JavaDoc idAttributeName) {
726         Object JavaDoc[] args = { entityClass, embeddedIdAttributeName, idAttributeName };
727         
728         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EMBEDDED_ID_AND_ID_ANNOTATIONS_FOUND, args));
729         validationException.setErrorCode(EMBEDDED_ID_AND_ID_ANNOTATIONS_FOUND);
730         return validationException;
731     }
732
733     public static ValidationException embeddedIdAndIdElementFound(Class JavaDoc entityClass, String JavaDoc embeddedIdAttributeName, String JavaDoc idAttributeName) {
734         Object JavaDoc[] args = { entityClass, embeddedIdAttributeName, idAttributeName };
735         
736         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EMBEDDED_ID_AND_ID_ELEMENTS_FOUND, args));
737         validationException.setErrorCode(EMBEDDED_ID_AND_ID_ELEMENTS_FOUND);
738         return validationException;
739     }
740
741     public static ValidationException errorDecryptingPassword(Exception JavaDoc exception) {
742         Object JavaDoc[] args = { };
743         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ERROR_DECRYPTING_PASSWORD, args), exception);
744         validationException.setErrorCode(ERROR_DECRYPTING_PASSWORD);
745         return validationException;
746     }
747
748     public static ValidationException invalidEncryptionClass(String JavaDoc className, Throwable JavaDoc throwableError) {
749         Object JavaDoc[] args = { className };
750         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_ENCRYPTION_CLASS, args));
751         validationException.setErrorCode(INVALID_ENCRYPTION_CLASS);
752         validationException.setInternalException(throwableError);
753         return validationException;
754     }
755     
756     public static ValidationException invalidEntityCallbackMethodArguments(Class JavaDoc entityClass, String JavaDoc methodName) {
757         Object JavaDoc[] args = { entityClass, methodName };
758
759         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_ENTITY_CALLBACK_METHOD_ARGUMENTS, args));
760         validationException.setErrorCode(INVALID_ENTITY_CALLBACK_METHOD_ARGUMENTS);
761         return validationException;
762     }
763     
764     public static ValidationException invalidEntityListenerCallbackMethodArguments(Class JavaDoc entityClass, Class JavaDoc parameterClass, Class JavaDoc entityListener, String JavaDoc methodName) {
765         Object JavaDoc[] args = { entityClass, parameterClass, entityListener, methodName };
766
767         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_ENTITY_LISTENER_CALLBACK_METHOD_ARGUMENTS, args));
768         validationException.setErrorCode(INVALID_ENTITY_LISTENER_CALLBACK_METHOD_ARGUMENTS);
769         return validationException;
770     }
771
772     public static ValidationException noTopLinkEjbJarXMLFound() {
773         Object JavaDoc[] args = { };
774         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_TOPLINK_EJB_JAR_XML_FOUND, args));
775         validationException.setErrorCode(NO_TOPLINK_EJB_JAR_XML_FOUND);
776         return validationException;
777     }
778
779     public static ValidationException excusiveConnectionIsNoLongerAvailable(DatabaseQuery query, AbstractSession session) {
780         Object JavaDoc[] args = { query.getReferenceClass().getName() };
781         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EXCLUSIVE_CONNECTION_NO_LONGER_AVAILABLE, args));
782         validationException.setErrorCode(EXCLUSIVE_CONNECTION_NO_LONGER_AVAILABLE);
783         validationException.setSession(session);
784         return validationException;
785     }
786
787     public static ValidationException existingQueryTypeConflict(DatabaseQuery newQuery, DatabaseQuery existingQuery) {
788         Object JavaDoc[] args = { newQuery, newQuery.getName(), newQuery.getArgumentTypes(), existingQuery, existingQuery.getName(), existingQuery.getArgumentTypes() };
789         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EXISTING_QUERY_TYPE_CONFLICT, args));
790         validationException.setErrorCode(EXISTING_QUERY_TYPE_CONFLICT);
791         return validationException;
792     }
793
794     public static ValidationException fatalErrorOccurred(Exception JavaDoc exception) {
795         Object JavaDoc[] args = { };
796
797         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, FATAL_ERROR_OCCURRED, args), exception);
798         validationException.setErrorCode(FATAL_ERROR_OCCURRED);
799         return validationException;
800     }
801
802     public static ValidationException featureIsNotAvailableInRunningJDKVersion(String JavaDoc feature) {
803         Object JavaDoc[] args = { feature, System.getProperty("java.version") };
804         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, FEATURE_NOT_SUPPORTED_IN_JDK_VERSION, args));
805         validationException.setErrorCode(FEATURE_NOT_SUPPORTED_IN_JDK_VERSION);
806         return validationException;
807     }
808
809     public static ValidationException fieldLevelLockingNotSupportedWithoutUnitOfWork() {
810         Object JavaDoc[] args = { };
811
812         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, FIELD_LEVEL_LOCKING_NOTSUPPORTED_OUTSIDE_A_UNIT_OF_WORK, args));
813         validationException.setErrorCode(FIELD_LEVEL_LOCKING_NOTSUPPORTED_OUTSIDE_A_UNIT_OF_WORK);
814         return validationException;
815     }
816
817     /**
818      * PUBLIC:
819      * Possible cause: The order-by value provided does not correspond to an attribute on the target entity.
820      * Action: Ensure that an attribute with the same name as the order-by value exists on the target entity.
821      */

822     public static ValidationException invalidOrderByValue(String JavaDoc referenceAttribute, Class JavaDoc referenceClass, String JavaDoc entityAttribute, Class JavaDoc entityClass) {
823         Object JavaDoc[] args = { referenceAttribute, referenceClass, entityAttribute, entityClass };
824
825         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_ORDER_BY_VALUE, args));
826         validationException.setErrorCode(INVALID_ORDER_BY_VALUE);
827         return validationException;
828     }
829
830     public static ValidationException fileError(java.io.IOException JavaDoc exception) {
831         Object JavaDoc[] args = { };
832
833         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, FILE_ERROR, args), exception);
834         validationException.setErrorCode(FILE_ERROR);
835         return validationException;
836     }
837     
838     public static ValidationException illegalContainerClass(Class JavaDoc aClass) {
839         Object JavaDoc[] args = { aClass.toString() };
840
841         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ILLEGAL_CONTAINER_CLASS, args));
842         validationException.setErrorCode(ILLEGAL_CONTAINER_CLASS);
843         return validationException;
844     }
845
846     public static ValidationException illegalUseOfMapInDirectCollection(oracle.toplink.essentials.mappings.DirectCollectionMapping directCollectionMapping, Class JavaDoc aMapClass, String JavaDoc keyMethodName) {
847         Object JavaDoc[] args = { directCollectionMapping, keyMethodName };
848
849         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ILLEGAL_USE_OF_MAP_IN_DIRECTCOLLECTION, args));
850         validationException.setErrorCode(ILLEGAL_USE_OF_MAP_IN_DIRECTCOLLECTION);
851         return validationException;
852     }
853
854     public static ValidationException incorrectLoginInstanceProvided() {
855         Object JavaDoc[] args = { };
856
857         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INCORRECT_LOGIN_INSTANCE_PROVIDED, args));
858         validationException.setErrorCode(INCORRECT_LOGIN_INSTANCE_PROVIDED);
859         return validationException;
860     }
861     
862     public static ValidationException instantiatingValueholderWithNullSession() {
863         Object JavaDoc[] args = { };
864
865         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION, args));
866         validationException.setErrorCode(INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION);
867         return validationException;
868     }
869     
870     /**
871      * PUBLIC:
872      * Possible cause: A mapping for the attribute name specified in the attribute-override cannot be found
873      * in the descriptor for the embeddable class.
874      * Action: Ensure that there is an attribute on the embeddable class matching the attribute name in the
875      * attribute-override declaration.
876      */

877     public static ValidationException invalidAttributeOverrideName(String JavaDoc columnName, Class JavaDoc embeddableClass) {
878         Object JavaDoc[] args = { columnName, embeddableClass };
879
880         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_ATTRIBUTE_OVERRIDE_NAME, args));
881         validationException.setErrorCode(INVALID_ATTRIBUTE_OVERRIDE_NAME);
882         return validationException;
883     }
884
885     public static ValidationException invalidCallbackMethod(Class JavaDoc listenerClass, String JavaDoc methodName) {
886         Object JavaDoc[] args = { listenerClass, methodName };
887
888         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_CALLBACK_METHOD, args));
889         validationException.setErrorCode(INVALID_CALLBACK_METHOD);
890         return validationException;
891     }
892     
893     public static ValidationException invalidCallbackMethodModifier(Class JavaDoc listenerClass, String JavaDoc methodName) {
894         Object JavaDoc[] args = { listenerClass, methodName };
895
896         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_CALLBACK_METHOD_MODIFIER, args));
897         validationException.setErrorCode(INVALID_CALLBACK_METHOD_MODIFIER);
898         return validationException;
899     }
900     
901     public static ValidationException invalidCallbackMethodName(Class JavaDoc listenerClass, String JavaDoc methodName) {
902         Object JavaDoc[] args = { listenerClass, methodName };
903
904         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_CALLBACK_METHOD_NAME, args));
905         validationException.setErrorCode(INVALID_CALLBACK_METHOD_NAME);
906         return validationException;
907     }
908     
909     public static ValidationException invalidClassTypeForBLOBAttribute(Class JavaDoc entityClass, String JavaDoc attributeName) {
910         Object JavaDoc[] args = { entityClass, attributeName };
911
912         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_CLASS_TYPE_FOR_BLOB_ATTRIBUTE, args));
913         validationException.setErrorCode(INVALID_CLASS_TYPE_FOR_BLOB_ATTRIBUTE);
914         return validationException;
915     }
916     
917     public static ValidationException invalidClassTypeForCLOBAttribute(Class JavaDoc entityClass, String JavaDoc attributeName) {
918         Object JavaDoc[] args = { entityClass, attributeName };
919
920         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_CLASS_TYPE_FOR_CLOB_ATTRIBUTE, args));
921         validationException.setErrorCode(INVALID_CLASS_TYPE_FOR_CLOB_ATTRIBUTE);
922         return validationException;
923     }
924     
925     public static ValidationException invalidTypeForEnumeratedAttribute(String JavaDoc attributeName, Class JavaDoc targetClass, Class JavaDoc entityClass) {
926         Object JavaDoc[] args = { attributeName, targetClass, entityClass };
927         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_TYPE_FOR_ENUMERATED_ATTRIBUTE, args));
928         validationException.setErrorCode(INVALID_TYPE_FOR_ENUMERATED_ATTRIBUTE);
929         return validationException;
930     }
931     
932     public static ValidationException invalidTypeForLOBAttribute(String JavaDoc attributeName, Class JavaDoc targetClass, Class JavaDoc entityClass) {
933         Object JavaDoc[] args = { attributeName, targetClass, entityClass };
934         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_TYPE_FOR_LOB_ATTRIBUTE, args));
935         validationException.setErrorCode(INVALID_TYPE_FOR_LOB_ATTRIBUTE);
936         return validationException;
937     }
938     
939     public static ValidationException invalidTypeForSerializedAttribute(String JavaDoc attributeName, Class JavaDoc targetClass, Class JavaDoc entityClass) {
940         Object JavaDoc[] args = { attributeName, targetClass, entityClass };
941         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_TYPE_FOR_SERIALIZED_ATTRIBUTE, args));
942         validationException.setErrorCode(INVALID_TYPE_FOR_SERIALIZED_ATTRIBUTE);
943         return validationException;
944     }
945     
946     public static ValidationException invalidTypeForTemporalAttribute(String JavaDoc attributeName, Class JavaDoc targetClass, Class JavaDoc entityClass) {
947         Object JavaDoc[] args = { attributeName, targetClass, entityClass };
948         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_TYPE_FOR_TEMPORAL_ATTRIBUTE, args));
949         validationException.setErrorCode(INVALID_TYPE_FOR_TEMPORAL_ATTRIBUTE);
950         return validationException;
951     }
952     
953     public static ValidationException invalidTypeForVersionAttribute(String JavaDoc attributeName, Class JavaDoc lockingType, Class JavaDoc entityClass) {
954         Object JavaDoc[] args = { attributeName, lockingType, entityClass };
955         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_TYPE_FOR_VERSION_ATTRIBUTE, args));
956         validationException.setErrorCode(INVALID_TYPE_FOR_VERSION_ATTRIBUTE);
957         return validationException;
958     }
959
960     public static ValidationException invalidCollectionTypeForRelationship(Class JavaDoc rawClass, Object JavaDoc annotatedElement) {
961         Object JavaDoc[] args = { rawClass, annotatedElement };
962
963         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_COLLECTION_TYPE_FOR_RELATIONSHIP, args));
964         validationException.setErrorCode(INVALID_COLLECTION_TYPE_FOR_RELATIONSHIP);
965         return validationException;
966     }
967     
968     public static ValidationException invalidColumnAnnotationOnRelationship(Class JavaDoc entityClass, String JavaDoc attributeName) {
969         Object JavaDoc[] args = { entityClass, attributeName };
970
971         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_COLUMN_ANNOTATION_ON_RELATIONSHIP, args));
972         validationException.setErrorCode(INVALID_COLUMN_ANNOTATION_ON_RELATIONSHIP);
973         return validationException;
974     }
975         
976     public static ValidationException invalidColumnElementOnRelationship(Class JavaDoc entityClass, String JavaDoc attributeName) {
977         Object JavaDoc[] args = { entityClass, attributeName };
978
979         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_COLUMN_ELEMENT_ON_RELATIONSHIP, args));
980         validationException.setErrorCode(INVALID_COLUMN_ELEMENT_ON_RELATIONSHIP);
981         return validationException;
982     }
983
984     public static ValidationException invalidCompositePKAttribute(Class JavaDoc entityClass, String JavaDoc pkClassName, String JavaDoc attributeName, Type expectedType, Type actualType) {
985         Object JavaDoc[] args = { entityClass, pkClassName, attributeName, expectedType, actualType };
986
987         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_COMPOSITE_PK_ATTRIBUTE, args));
988         validationException.setErrorCode(INVALID_COMPOSITE_PK_ATTRIBUTE);
989         return validationException;
990     }
991     
992     public static ValidationException invalidCompositePKSpecification(Class JavaDoc entityClass, String JavaDoc pkClassName) {
993         Object JavaDoc[] args = { entityClass, pkClassName };
994
995         ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_COMPOSITE_PK_SPECIFICATION, args));
996         validationException.setErrorCode(INVALID_COMPOSITE_PK_SPECIFICATION);
997         return validationException;
998     }
999     
1000    public static ValidationException invalidConnector(oracle.toplink.essentials.sessions.Connector connector) {
1001        Object JavaDoc[] args = { connector };
1002
1003        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_CONNECTOR, args));
1004        validationException.setErrorCode(INVALID_CONNECTOR);
1005        return validationException;
1006    }
1007
1008    public static ValidationException invalidDataSourceName(String JavaDoc name, Exception JavaDoc exception) {
1009        Object JavaDoc[] args = { name };
1010
1011        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_DATA_SOURCE_NAME, args), exception);
1012        validationException.setErrorCode(INVALID_DATA_SOURCE_NAME);
1013        return validationException;
1014    }
1015
1016    public static ValidationException invalidEmbeddableAttribute(Class JavaDoc aggregateClass, String JavaDoc aggregateAttributeName, Class JavaDoc owningClass, String JavaDoc owningAttributeName) {
1017        Object JavaDoc[] args = { aggregateClass, aggregateAttributeName, owningClass, owningAttributeName};
1018
1019        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_EMBEDDABLE_ATTRIBUTE, args));
1020        validationException.setErrorCode(INVALID_EMBEDDABLE_ATTRIBUTE);
1021        return validationException;
1022    }
1023
1024    /**
1025     * PUBLIC:
1026     * Possible cause: Either the URL for the entity-mappings document is invalid, or there is an error in the document.
1027     * Action: Verify that the URL is correct. If so, analyze the exception message for an indication of what is wrong withthe document.
1028     */

1029    public static ValidationException invalidEntityMappingsDocument(String JavaDoc fileName, Exception JavaDoc exception) {
1030        Object JavaDoc[] args = { fileName };
1031
1032        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_ENTITY_MAPPINGS_DOCUMENT, args), exception);
1033        validationException.setErrorCode(INVALID_ENTITY_MAPPINGS_DOCUMENT);
1034        return validationException;
1035    }
1036    
1037    public static ValidationException invalidFileName(String JavaDoc fileName) {
1038        Object JavaDoc[] args = { fileName };
1039
1040        ValidationException exception = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_FILE_TYPE, args));
1041        exception.setErrorCode(INVALID_FILE_TYPE);
1042        return exception;
1043    }
1044
1045    public static ValidationException invalidMergePolicy() {
1046        Object JavaDoc[] args = { };
1047
1048        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_MERGE_POLICY, args));
1049        validationException.setErrorCode(INVALID_MERGE_POLICY);
1050        return validationException;
1051    }
1052
1053    public static ValidationException javaTypeIsNotAValidDatabaseType(Class JavaDoc javaClass) {
1054        Object JavaDoc[] args = { javaClass };
1055
1056        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, JAVA_TYPE_IS_NOT_A_VALID_DATABASE_TYPE, args));
1057        validationException.setErrorCode(JAVA_TYPE_IS_NOT_A_VALID_DATABASE_TYPE);
1058        return validationException;
1059    }
1060
1061    public static ValidationException jtsExceptionRaised(Exception JavaDoc exception) {
1062        Object JavaDoc[] args = { };
1063
1064        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, JTS_EXCEPTION_RAISED, args), exception);
1065        validationException.setErrorCode(JTS_EXCEPTION_RAISED);
1066        return validationException;
1067    }
1068
1069    public static ValidationException loginBeforeAllocatingClientSessions() {
1070        Object JavaDoc[] args = { };
1071
1072        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, LOGIN_BEFORE_ALLOCATING_CLIENT_SESSIONS, args));
1073        validationException.setErrorCode(LOGIN_BEFORE_ALLOCATING_CLIENT_SESSIONS);
1074        return validationException;
1075    }
1076
1077    public static ValidationException logIOError(java.io.IOException JavaDoc exception) {
1078        Object JavaDoc[] args = { };
1079
1080        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, LOG_IO_ERROR, args), exception);
1081        validationException.setErrorCode(LOG_IO_ERROR);
1082        return validationException;
1083    }
1084    
1085    public static ValidationException mapKeyNotDeclaredInItemClass(String JavaDoc keyName, Class JavaDoc aClass) {
1086        Object JavaDoc[] args = { keyName, aClass };
1087
1088        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MAP_KEY_NOT_DECLARED_IN_ITEM_CLASS, args));
1089        validationException.setErrorCode(MAP_KEY_NOT_DECLARED_IN_ITEM_CLASS);
1090        return validationException;
1091    }
1092
1093    public static ValidationException maxSizeLessThanMinSize() {
1094        Object JavaDoc[] args = { };
1095
1096        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MAX_SIZE_LESS_THAN_MIN_SIZE, args));
1097        validationException.setErrorCode(MAX_SIZE_LESS_THAN_MIN_SIZE);
1098        return validationException;
1099    }
1100
1101    public static ValidationException noMappedByAttributeFound(Class JavaDoc ownerClass, String JavaDoc mappedByAttributeName, Class JavaDoc entityClass, String JavaDoc attributeName) {
1102        Object JavaDoc[] args = { ownerClass, mappedByAttributeName, entityClass, attributeName };
1103
1104        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_MAPPED_BY_ATTRIBUTE_FOUND, args));
1105        validationException.setErrorCode(NO_MAPPED_BY_ATTRIBUTE_FOUND);
1106        return validationException;
1107    }
1108    
1109    public static ValidationException noPrimaryKeyAnnotationsFound(Class JavaDoc entityClass) {
1110        Object JavaDoc[] args = { entityClass };
1111
1112        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_PK_ANNOTATIONS_FOUND, args));
1113        validationException.setErrorCode(NO_PK_ANNOTATIONS_FOUND);
1114        return validationException;
1115    }
1116    
1117    /**
1118    * PUBLIC:
1119    * Possible cause: The TopLink.properties file does not include any reference to a project class, file, or xml project file for the session specified in the deployment descriptor.
1120    * Action: Edit the TopLink.properties file to include the desired project.
1121    */

1122    public static ValidationException noProjectSpecifiedInProperties(String JavaDoc bundleName, String JavaDoc serverName) {
1123        Object JavaDoc[] args = { bundleName, serverName };
1124
1125        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_PROJECT_SPECIFIED_IN_PROPERTIES, args));
1126        validationException.setErrorCode(NO_PROJECT_SPECIFIED_IN_PROPERTIES);
1127        return validationException;
1128    }
1129
1130    public static ValidationException noSessionFound(String JavaDoc sessionName, String JavaDoc resourceName) {
1131        Object JavaDoc[] args = { sessionName, resourceName };
1132
1133        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_SESSION_FOUND, args));
1134        validationException.setErrorCode(NO_SESSION_FOUND);
1135        return validationException;
1136    }
1137
1138    public static ValidationException noSessionRegisteredForClass(Class JavaDoc domainClass) {
1139        Object JavaDoc[] args = { domainClass };
1140
1141        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_SESSION_REGISTERED_FOR_CLASS, args));
1142        validationException.setErrorCode(NO_SESSION_REGISTERED_FOR_CLASS);
1143        return validationException;
1144    }
1145
1146    public static ValidationException noSessionRegisteredForName(String JavaDoc sessionName) {
1147        Object JavaDoc[] args = { sessionName };
1148
1149        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_SESSION_REGISTERED_FOR_NAME, args));
1150        validationException.setErrorCode(NO_SESSION_REGISTERED_FOR_NAME);
1151        return validationException;
1152    }
1153
1154    public static ValidationException noTablesToCreate(oracle.toplink.essentials.sessions.Project project) {
1155        Object JavaDoc[] args = { project };
1156
1157        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_TABLES_TO_CREATE, args));
1158        validationException.setErrorCode(NO_TABLES_TO_CREATE);
1159        return validationException;
1160    }
1161    
1162    public static ValidationException noTemporalTypeSpecified(String JavaDoc attributeName, Class JavaDoc entityClass) {
1163        Object JavaDoc[] args = { attributeName, entityClass };
1164        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_TEMPORAL_TYPE_SPECIFIED, args));
1165        validationException.setErrorCode(NO_TEMPORAL_TYPE_SPECIFIED);
1166        return validationException;
1167    }
1168
1169    public static ValidationException uniDirectionalOneToManyHasJoinColumnAnnotations(Class JavaDoc entityClass, String JavaDoc attributeName) {
1170        Object JavaDoc[] args = { entityClass, attributeName };
1171
1172        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNI_DIRECTIONAL_ONE_TO_MANY_HAS_JOINCOLUMN_ANNOTATIONS, args));
1173        validationException.setErrorCode(UNI_DIRECTIONAL_ONE_TO_MANY_HAS_JOINCOLUMN_ANNOTATIONS);
1174        return validationException;
1175    }
1176    
1177    public static ValidationException uniDirectionalOneToManyHasJoinColumnElements(Class JavaDoc entityClass, String JavaDoc attributeName) {
1178        Object JavaDoc[] args = { entityClass, attributeName };
1179
1180        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNI_DIRECTIONAL_ONE_TO_MANY_HAS_JOINCOLUMN_ELEMENTS, args));
1181        validationException.setErrorCode(UNI_DIRECTIONAL_ONE_TO_MANY_HAS_JOINCOLUMN_ELEMENTS);
1182        return validationException;
1183    }
1184    
1185    public static ValidationException onlyFieldsAreValidKeysForDatabaseRows() {
1186        Object JavaDoc[] args = { };
1187
1188        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ONLY_FIELDS_ARE_VALID_KEYS_FOR_DATABASE_ROWS, args));
1189        validationException.setErrorCode(ONLY_FIELDS_ARE_VALID_KEYS_FOR_DATABASE_ROWS);
1190        return validationException;
1191    }
1192
1193    public static ValidationException operationNotSupported(String JavaDoc methodName) {
1194        Object JavaDoc[] args = { methodName };
1195
1196        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, OPERATION_NOT_SUPPORTED, args));
1197        validationException.setErrorCode(OPERATION_NOT_SUPPORTED);
1198        return validationException;
1199    }
1200
1201    public static ValidationException optimisticLockingNotSupportedWithStoredProcedureGeneration() {
1202        Object JavaDoc[] args = { };
1203
1204        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, OPTIMISTIC_LOCKING_NOT_SUPPORTED, args));
1205        validationException.setErrorCode(OPTIMISTIC_LOCKING_NOT_SUPPORTED);
1206        return validationException;
1207    }
1208
1209    public static ValidationException oracleObjectTypeIsNotDefined(String JavaDoc typeName) {
1210        Object JavaDoc[] args = { typeName };
1211
1212        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ORACLE_OBJECT_TYPE_NOT_DEFINED, args));
1213        validationException.setErrorCode(ORACLE_OBJECT_TYPE_NOT_DEFINED);
1214        return validationException;
1215    }
1216
1217    public static ValidationException oracleObjectTypeNameIsNotDefined(Class JavaDoc type) {
1218        Object JavaDoc[] args = { type };
1219
1220        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ORACLE_OBJECT_TYPE_NAME_NOT_DEFINED, args));
1221        validationException.setErrorCode(ORACLE_OBJECT_TYPE_NAME_NOT_DEFINED);
1222        return validationException;
1223    }
1224
1225    public static ValidationException oracleVarrayMaximumSizeNotDefined(String JavaDoc typeName) {
1226        Object JavaDoc[] args = { typeName };
1227
1228        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ORACLE_VARRAY_MAXIMIM_SIZE_NOT_DEFINED, args));
1229        validationException.setErrorCode(ORACLE_VARRAY_MAXIMIM_SIZE_NOT_DEFINED);
1230        return validationException;
1231    }
1232
1233    public static ValidationException persistenceUnitMetadataConflict(String JavaDoc tagName) {
1234        Object JavaDoc[] args = { tagName };
1235
1236        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PERSISTENCE_UNIT_METADATA_CONFLICT, args));
1237        validationException.setErrorCode(PERSISTENCE_UNIT_METADATA_CONFLICT);
1238        return validationException;
1239    }
1240
1241    public static ValidationException platformClassNotFound(Exception JavaDoc exception, String JavaDoc className) {
1242        Object JavaDoc[] args = { className };
1243
1244        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PLATFORM_CLASS_NOT_FOUND, args), exception);
1245        validationException.setErrorCode(PLATFORM_CLASS_NOT_FOUND);
1246        return validationException;
1247    }
1248
1249    public static ValidationException poolNameDoesNotExist(String JavaDoc poolName) {
1250        Object JavaDoc[] args = { poolName };
1251
1252        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, POOL_NAME_DOES_NOT_EXIST, args));
1253        validationException.setErrorCode(POOL_NAME_DOES_NOT_EXIST);
1254        return validationException;
1255    }
1256
1257    public static ValidationException poolsMustBeConfiguredBeforeLogin() {
1258        Object JavaDoc[] args = { };
1259
1260        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, POOLS_MUST_BE_CONFIGURED_BEFORE_LOGIN, args));
1261        validationException.setErrorCode(POOLS_MUST_BE_CONFIGURED_BEFORE_LOGIN);
1262        return validationException;
1263    }
1264
1265    /**
1266    * PUBLIC:
1267    * Possible cause: Instance document is incomplete - primary tables must be
1268    * defined for both sides of a relationhip.
1269    * Action: Make sure that each entity of a relationship has a primary table defined.
1270    */

1271    public static ValidationException primaryTableNotDefined(Class JavaDoc javaClass, String JavaDoc instanceDocName) {
1272        Object JavaDoc[] args = { javaClass, instanceDocName };
1273
1274        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PRIMARY_TABLE_NOT_DEFINED_FOR_RELATIONSHIP, args));
1275        validationException.setErrorCode(PRIMARY_TABLE_NOT_DEFINED_FOR_RELATIONSHIP);
1276        return validationException;
1277    }
1278
1279    /**
1280    * PUBLIC:
1281    * Possible cause: An amendment method was called but can not be found.
1282    * Action: Check that the required amendment method exists on the class specified.
1283    */

1284    public static ValidationException projectAmendmentExceptionOccured(Exception JavaDoc exception, String JavaDoc amendmentMethod, String JavaDoc amendmentClass) {
1285        Object JavaDoc[] args = { amendmentMethod, amendmentClass };
1286
1287        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PROJECT_AMENDMENT_EXCEPTION_OCCURED, args));
1288        validationException.setInternalException(exception);
1289        validationException.setErrorCode(PROJECT_AMENDMENT_EXCEPTION_OCCURED);
1290        return validationException;
1291    }
1292
1293    public static ValidationException projectXMLNotFound(String JavaDoc projectXMLFile, Exception JavaDoc exception) {
1294        Object JavaDoc[] args = { projectXMLFile };
1295        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PROJECT_XML_NOT_FOUND, args));
1296        validationException.setInternalException(exception);
1297        validationException.setErrorCode(PROJECT_XML_NOT_FOUND);
1298        return validationException;
1299    }
1300
1301    public static ValidationException queryArgumentTypeNotFound(DatabaseQuery query, String JavaDoc argumentName, String JavaDoc typeAsString, Exception JavaDoc exception) {
1302        Object JavaDoc[] args = { query.getName(), argumentName, typeAsString };
1303
1304        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, QUERY_ARGUMENT_TYPE_NOT_FOUND, args));
1305        validationException.setInternalException(exception);
1306        validationException.setErrorCode(QUERY_ARGUMENT_TYPE_NOT_FOUND);
1307        return validationException;
1308    }
1309
1310    public static ValidationException sequenceSetupIncorrectly(String JavaDoc sequenceName) {
1311        Object JavaDoc[] args = { sequenceName };
1312
1313        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SEQUENCE_SETUP_INCORRECTLY, args));
1314        validationException.setErrorCode(SEQUENCE_SETUP_INCORRECTLY);
1315        return validationException;
1316    }
1317
1318    /**
1319    * PUBLIC:
1320    * Possible cause: An attempt was made to modify the ServerPlatform after login.
1321    * Action: All changes to the ServerPlatform must be made before login.
1322    */

1323    public static ValidationException serverPlatformIsReadOnlyAfterLogin(String JavaDoc serverPlatformClassName) {
1324        Object JavaDoc[] args = { serverPlatformClassName };
1325
1326        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SERVER_PLATFORM_IS_READ_ONLY_AFTER_LOGIN, args));
1327        validationException.setErrorCode(SERVER_PLATFORM_IS_READ_ONLY_AFTER_LOGIN);
1328        return validationException;
1329    }
1330
1331    /**
1332    * PUBLIC:
1333    * Possible cause: An amendment method was called but can not be found.
1334    * Action: Check that the required amendment method exists on the class specified.
1335    */

1336    public static ValidationException sessionAmendmentExceptionOccured(Exception JavaDoc exception, String JavaDoc amendmentMethod, String JavaDoc amendmentClass, Class JavaDoc[] parameters) {
1337        StringBuffer JavaDoc buf = new StringBuffer JavaDoc(30);
1338        for (int i = 0; i < (parameters.length - 1); i++) {
1339            buf.append(parameters[i].getName());
1340            if (i != (parameters.length - 1)) {
1341                buf.append(", ");
1342            }
1343        }
1344        buf.append(parameters[parameters.length - 1].getName());
1345
1346        Object JavaDoc[] args = { amendmentClass, amendmentMethod, buf.toString() };
1347
1348        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SESSION_AMENDMENT_EXCEPTION_OCCURED, args));
1349        validationException.setInternalException(exception);
1350        validationException.setErrorCode(SESSION_AMENDMENT_EXCEPTION_OCCURED);
1351        return validationException;
1352    }
1353
1354    public static ValidationException startIndexOutOfRange() {
1355        Object JavaDoc[] args = { };
1356
1357        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, START_INDEX_OUT_OF_RANGE, args));
1358        validationException.setErrorCode(START_INDEX_OUT_OF_RANGE);
1359        return validationException;
1360    }
1361
1362    public static ValidationException stopIndexOutOfRange() {
1363        Object JavaDoc[] args = { };
1364
1365        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, STOP_INDEX_OUT_OF_RANGE, args));
1366        validationException.setErrorCode(STOP_INDEX_OUT_OF_RANGE);
1367        return validationException;
1368    }
1369
1370    /**
1371    * PUBLIC:
1372    * Possible cause: The session class specified in the TopLink.properties file for the session specified on the toplink_session_name environment variable can not be found.
1373    * Action: Check that the session class given in the exception is on the application server dependent classpath.
1374    */

1375    public static ValidationException subSessionsNotDefinedForBroker(String JavaDoc brokerName) {
1376        Object JavaDoc[] args = { brokerName };
1377
1378        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SUB_SESSION_NOT_DEFINED_FOR_BROKER, args));
1379        validationException.setErrorCode(SUB_SESSION_NOT_DEFINED_FOR_BROKER);
1380        return validationException;
1381    }
1382    
1383     /**
1384     * PUBLIC:
1385     * Possible cause: the type of the attribute is Map, Set, List or Collection, and no target-entity is defined.
1386     * Action: ensure that the target-entity is defined in the instance doc. for the relationship mapping.
1387     */

1388    public static ValidationException targetEntityCannotBeDetermined(Class JavaDoc attributeType, String JavaDoc attributeName, Class JavaDoc entityClass) {
1389        Object JavaDoc[] args = { attributeType, attributeName, entityClass };
1390
1391        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, TARGET_ENTITY_CANNOT_BE_DETERMINED, args));
1392        validationException.setErrorCode(TARGET_ENTITY_CANNOT_BE_DETERMINED);
1393        return validationException;
1394    }
1395
1396    public static ValidationException tablePerClassInheritanceNotSupported(Class JavaDoc entityClass) {
1397        Object JavaDoc[] args = { entityClass };
1398
1399        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, TABLE_PER_CLASS_INHERITANCE_NOT_SUPPORTED, args));
1400        validationException.setErrorCode(TABLE_PER_CLASS_INHERITANCE_NOT_SUPPORTED);
1401        return validationException;
1402    }
1403
1404    public static ValidationException writeObjectNotAllowedInUnitOfWork() {
1405        Object JavaDoc[] args = { };
1406
1407        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, WRITE_OBJECT_NOT_ALLOWED_IN_UNIT_OF_WORK, args));
1408        validationException.setErrorCode(WRITE_OBJECT_NOT_ALLOWED_IN_UNIT_OF_WORK);
1409        return validationException;
1410    }
1411
1412    public static ValidationException wrongObjectRegistered(Object JavaDoc registered, Object JavaDoc parent) {
1413        Object JavaDoc[] args = { registered, parent };
1414
1415        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, WRONG_OBJECT_REGISTERED, args));
1416        validationException.setErrorCode(WRONG_OBJECT_REGISTERED);
1417        return validationException;
1418    }
1419    
1420    public static ValidationException cannotIssueModifyAllQueryWithOtherWritesWithinUOW() {
1421        Object JavaDoc[] args = { };
1422
1423        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MODIFY_ALL_QUERIES_NOT_SUPPORTED_WITH_OTHER_WRITES, args));
1424        validationException.setErrorCode(MODIFY_ALL_QUERIES_NOT_SUPPORTED_WITH_OTHER_WRITES);
1425        return validationException;
1426    }
1427
1428    public static ValidationException nullCacheKeyFoundOnRemoval(IdentityMap map, Class JavaDoc clazz) {
1429        Object JavaDoc[] args = { map, clazz, CR };
1430        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NULL_CACHE_KEY_FOUND_ON_REMOVAL, args));
1431        validationException.setErrorCode(NULL_CACHE_KEY_FOUND_ON_REMOVAL);
1432        return validationException;
1433    }
1434
1435    public static ValidationException nullUnderlyingValueHolderValue(String JavaDoc methodName) {
1436        Object JavaDoc[] args = { methodName, CR };
1437        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NULL_UNDERLYING_VALUEHOLDER_VALUE, args));
1438        validationException.setErrorCode(NULL_UNDERLYING_VALUEHOLDER_VALUE);
1439        return validationException;
1440    }
1441
1442    public static ValidationException invalidSequencingLogin() {
1443        Object JavaDoc[] args = { };
1444        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_SEQUENCING_LOGIN, args));
1445        validationException.setErrorCode(INVALID_SEQUENCING_LOGIN);
1446        return validationException;
1447    }
1448
1449    public static ValidationException isolatedDataNotSupportedInSessionBroker(String JavaDoc sessionName) {
1450        Object JavaDoc[] args = { sessionName };
1451        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ISOLATED_DATA_NOT_SUPPORTED_IN_CLIENTSESSIONBROKER, args));
1452        validationException.setErrorCode(ISOLATED_DATA_NOT_SUPPORTED_IN_CLIENTSESSIONBROKER);
1453        return validationException;
1454    }
1455
1456    public static ValidationException projectLoginIsNull(AbstractSession session) {
1457        Object JavaDoc[] args = { };
1458        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PROJECT_LOGIN_IS_NULL, args));
1459        validationException.setErrorCode(PROJECT_LOGIN_IS_NULL);
1460        return validationException;
1461    }
1462
1463    public static ValidationException historicalSessionOnlySupportedOnOracle() {
1464        Object JavaDoc[] args = { };
1465
1466        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, HISTORICAL_SESSION_ONLY_SUPPORTED_ON_ORACLE, args));
1467        validationException.setErrorCode(HISTORICAL_SESSION_ONLY_SUPPORTED_ON_ORACLE);
1468        return validationException;
1469    }
1470
1471    public static ValidationException platformDoesNotSupportCallWithReturning(String JavaDoc platformTypeName) {
1472        Object JavaDoc[] args = { platformTypeName };
1473
1474        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PLATFORM_DOES_NOT_SUPPORT_CALL_WITH_RETURNING, args));
1475        validationException.setErrorCode(PLATFORM_DOES_NOT_SUPPORT_CALL_WITH_RETURNING);
1476        return validationException;
1477    }
1478
1479    public static ValidationException invalidNullMethodArguments() {
1480        Object JavaDoc[] args = { };
1481
1482        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_NULL_METHOD_ARGUMENTS, args));
1483        validationException.setErrorCode(INVALID_NULL_METHOD_ARGUMENTS);
1484        return validationException;
1485    }
1486
1487    public static ValidationException invalidMethodArguments() {
1488        Object JavaDoc[] args = { };
1489
1490        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_METHOD_ARGUMENTS, args));
1491        validationException.setErrorCode(INVALID_METHOD_ARGUMENTS);
1492        return validationException;
1493    }
1494
1495    public static ValidationException wrongUsageOfSetCustomArgumentTypeMethod(String JavaDoc callString) {
1496        Object JavaDoc[] args = { callString };
1497
1498        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, WRONG_USAGE_OF_SET_CUSTOM_SQL_ARGUMENT_TYPE_METOD, args));
1499        validationException.setErrorCode(WRONG_USAGE_OF_SET_CUSTOM_SQL_ARGUMENT_TYPE_METOD);
1500        return validationException;
1501    }
1502
1503    public static ValidationException cannotTranslateUnpreparedCall(String JavaDoc callString) {
1504        Object JavaDoc[] args = { callString };
1505
1506        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_TRANSLATE_UNPREPARED_CALL, args));
1507        validationException.setErrorCode(CANNOT_TRANSLATE_UNPREPARED_CALL);
1508        return validationException;
1509    }
1510
1511    public static ValidationException cannotSetCursorForParameterTypeOtherThanOut(String JavaDoc fieldName, String JavaDoc callString) {
1512        Object JavaDoc[] args = { fieldName, callString };
1513
1514        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_SET_CURSOR_FOR_PARAMETER_TYPE_OTHER_THAN_OUT, args));
1515        validationException.setErrorCode(CANNOT_SET_CURSOR_FOR_PARAMETER_TYPE_OTHER_THAN_OUT);
1516        return validationException;
1517    }
1518
1519    public static ValidationException platformDoesNotSupportStoredFunctions(String JavaDoc platformTypeName) {
1520        Object JavaDoc[] args = { platformTypeName };
1521
1522        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PLATFORM_DOES_NOT_SUPPORT_STORED_FUNCTIONS, args));
1523        validationException.setErrorCode(PLATFORM_DOES_NOT_SUPPORT_STORED_FUNCTIONS);
1524        return validationException;
1525    }
1526
1527    public static ValidationException illegalOperationForUnitOfWorkLifecycle(int lifecycle, String JavaDoc operation) {
1528        switch (lifecycle) {
1529        case UnitOfWorkImpl.CommitTransactionPending:
1530            return unitOfWorkInTransactionCommitPending(operation);
1531        case UnitOfWorkImpl.WriteChangesFailed:
1532            return unitOfWorkAfterWriteChangesFailed(operation);
1533        case UnitOfWorkImpl.Death:default:
1534            return inActiveUnitOfWork(operation);
1535        }
1536    }
1537
1538    public static ValidationException unitOfWorkInTransactionCommitPending(String JavaDoc operation) {
1539        Object JavaDoc[] args = { operation };
1540        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNIT_OF_WORK_IN_TRANSACTION_COMMIT_PENDING, args));
1541        validationException.setErrorCode(UNIT_OF_WORK_IN_TRANSACTION_COMMIT_PENDING);
1542        return validationException;
1543    }
1544    
1545    public static ValidationException unspecifiedCompositePKNotSupported(Class JavaDoc entityClass) {
1546        Object JavaDoc[] args = { entityClass };
1547        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNSPECIFIED_COMPOSITE_PK_NOT_SUPPORTED, args));
1548        validationException.setErrorCode(UNSPECIFIED_COMPOSITE_PK_NOT_SUPPORTED);
1549        return validationException;
1550    }
1551    
1552    public static ValidationException unsupportedCascadeLockingDescriptor(ClassDescriptor descriptor) {
1553        Object JavaDoc[] args = { descriptor };
1554        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNSUPPORTED_CASCADE_LOCKING_DESCRIPTOR, args));
1555        validationException.setErrorCode(UNSUPPORTED_CASCADE_LOCKING_DESCRIPTOR);
1556        return validationException;
1557    }
1558    
1559    public static ValidationException unsupportedCascadeLockingMapping(DatabaseMapping mapping) {
1560        Object JavaDoc[] args = { mapping };
1561        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNSUPPORTED_CASCADE_LOCKING_MAPPING, args));
1562        validationException.setErrorCode(UNSUPPORTED_CASCADE_LOCKING_MAPPING);
1563        return validationException;
1564    }
1565    
1566    public static ValidationException unsupportedCascadeLockingMappingWithCustomQuery(DatabaseMapping mapping) {
1567        Object JavaDoc[] args = { mapping };
1568        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNSUPPORTED_CASCADE_LOCKING_MAPPING_WITH_CUSTOM_QUERY, args));
1569        validationException.setErrorCode(UNSUPPORTED_CASCADE_LOCKING_MAPPING_WITH_CUSTOM_QUERY);
1570        return validationException;
1571    }
1572
1573    public static ValidationException unitOfWorkAfterWriteChangesFailed(String JavaDoc operation) {
1574        Object JavaDoc[] args = { operation };
1575        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNIT_OF_WORK_AFTER_WRITE_CHANGES_FAILED, args));
1576        validationException.setErrorCode(UNIT_OF_WORK_AFTER_WRITE_CHANGES_FAILED);
1577        return validationException;
1578    }
1579
1580    public static ValidationException inActiveUnitOfWork(String JavaDoc operation) {
1581        Object JavaDoc[] args = { operation };
1582        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INACTIVE_UNIT_OF_WORK, args));
1583        validationException.setErrorCode(INACTIVE_UNIT_OF_WORK);
1584        return validationException;
1585    }
1586    
1587    public static ValidationException incompleteJoinColumnsSpecified(Object JavaDoc annotatedElement, Class JavaDoc javaClass) {
1588        Object JavaDoc[] args = { annotatedElement, javaClass };
1589
1590        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INCOMPLETE_JOIN_COLUMNS_SPECIFIED, args));
1591        validationException.setErrorCode(INCOMPLETE_JOIN_COLUMNS_SPECIFIED);
1592        return validationException;
1593    }
1594    
1595    public static ValidationException incompleteJoinColumnElementsSpecified(Object JavaDoc attributeName, Class JavaDoc javaClass) {
1596        Object JavaDoc[] args = { attributeName, javaClass };
1597
1598        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INCOMPLETE_JOIN_COLUMN_ELEMENTS_SPECIFIED, args));
1599        validationException.setErrorCode(INCOMPLETE_JOIN_COLUMN_ELEMENTS_SPECIFIED);
1600        return validationException;
1601    }
1602
1603    public static ValidationException incompletePrimaryKeyJoinColumnElementsSpecified(Object JavaDoc annotatedElement) {
1604        Object JavaDoc[] args = { annotatedElement };
1605
1606        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INCOMPLETE_PK_JOIN_COLUMN_ELEMENTS_SPECIFIED, args));
1607        validationException.setErrorCode(INCOMPLETE_PK_JOIN_COLUMN_ELEMENTS_SPECIFIED);
1608        return validationException;
1609    }
1610
1611    public static ValidationException incompletePrimaryKeyJoinColumnsSpecified(Object JavaDoc annotatedElement) {
1612        Object JavaDoc[] args = { annotatedElement };
1613
1614        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INCOMPLETE_PRIMARY_KEY_JOIN_COLUMNS_SPECIFIED, args));
1615        validationException.setErrorCode(INCOMPLETE_PRIMARY_KEY_JOIN_COLUMNS_SPECIFIED);
1616        return validationException;
1617    }
1618    
1619    public static ValidationException unitOfWorkInTransactionCommitPending() {
1620        Object JavaDoc[] args = { };
1621        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNIT_OF_WORK_IN_TRANSACTION_COMMIT_PENDING, args));
1622        validationException.setErrorCode(UNIT_OF_WORK_IN_TRANSACTION_COMMIT_PENDING);
1623        return validationException;
1624    }
1625
1626    public static ValidationException writeChangesOnNestedUnitOfWork() {
1627        Object JavaDoc[] args = { };
1628        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_WRITE_CHANGES_ON_NESTED_UNIT_OF_WORK, args));
1629        validationException.setErrorCode(CANNOT_WRITE_CHANGES_ON_NESTED_UNIT_OF_WORK);
1630        return validationException;
1631    }
1632
1633    public static ValidationException cannotWriteChangesTwice() {
1634        Object JavaDoc[] args = { };
1635        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_WRITE_CHANGES_TWICE, args));
1636        validationException.setErrorCode(CANNOT_WRITE_CHANGES_TWICE);
1637        return validationException;
1638    }
1639    
1640    public static ValidationException nestedUOWNotSupportedForAttributeTracking() {
1641        Object JavaDoc[] args = { };
1642        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NESTED_UOW_NOT_SUPPORTED_FOR_ATTRIBUTE_TRACKING, args));
1643        validationException.setErrorCode(NESTED_UOW_NOT_SUPPORTED_FOR_ATTRIBUTE_TRACKING);
1644        return validationException;
1645    }
1646
1647    public static ValidationException nestedUOWNotSupportedForModifyAllQuery() {
1648        Object JavaDoc[] args = { };
1649        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NESTED_UOW_NOT_SUPPORTED_FOR_MODIFY_ALL_QUERY, args));
1650        validationException.setErrorCode(NESTED_UOW_NOT_SUPPORTED_FOR_MODIFY_ALL_QUERY);
1651        return validationException;
1652    }
1653    
1654    public static ValidationException noCorrespondingSetterMethodDefined(Class JavaDoc entityClass, Method method) {
1655        Object JavaDoc[] args = { entityClass, method };
1656        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, NO_CORRESPONDING_SETTER_METHOD_DEFINED, args));
1657        validationException.setErrorCode(NO_CORRESPONDING_SETTER_METHOD_DEFINED);
1658        return validationException;
1659    }
1660
1661    public static ValidationException wrongCollectionChangeEventType(int eveType) {
1662        Object JavaDoc[] args = { new Integer JavaDoc(eveType) };
1663        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, WRONG_COLLECTION_CHANGE_EVENT_TYPE, args));
1664        validationException.setErrorCode(WRONG_COLLECTION_CHANGE_EVENT_TYPE);
1665        return validationException;
1666    }
1667
1668    public static ValidationException wrongChangeEvent(Class JavaDoc eveClass) {
1669        Object JavaDoc[] args = { eveClass };
1670        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, WRONG_CHANGE_EVENT, args));
1671        validationException.setErrorCode(WRONG_CHANGE_EVENT);
1672        return validationException;
1673    }
1674
1675    public static ValidationException oldCommitNotSupportedForAttributeTracking() {
1676        Object JavaDoc[] args = { };
1677        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, OLD_COMMIT_NOT_SUPPORTED_FOR_ATTRIBUTE_TRACKING, args));
1678        validationException.setErrorCode(OLD_COMMIT_NOT_SUPPORTED_FOR_ATTRIBUTE_TRACKING);
1679        return validationException;
1680    }
1681
1682    /**
1683     * PUBLIC:
1684     * Possible cause: An field name has been encountered that does not exist on
1685     * the associated entity.
1686     * Action: Ensure that a field with a matching name exists on the associated
1687     * entity.
1688     */

1689    public static ValidationException unableToDetermineClassForField(String JavaDoc fieldName, Class JavaDoc entityClass) {
1690        Object JavaDoc[] args = { fieldName, entityClass };
1691
1692        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNABLE_TO_DETERMINE_CLASS_FOR_FIELD, args));
1693        validationException.setErrorCode(UNABLE_TO_DETERMINE_CLASS_FOR_FIELD);
1694        return validationException;
1695    }
1696    
1697    /**
1698     * PUBLIC:
1699     * Possible cause: An property name has been encountered that does not exist
1700     * on the associated entity.
1701     * Action: Ensure that a property with a matching name exists on the
1702     * associated entity.
1703     */

1704    public static ValidationException unableToDetermineClassForProperty(String JavaDoc propertyName, Class JavaDoc entityClass) {
1705        Object JavaDoc[] args = { propertyName, entityClass };
1706
1707        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNABLE_TO_DETERMINE_CLASS_FOR_PROPERTY, args));
1708        validationException.setErrorCode(UNABLE_TO_DETERMINE_CLASS_FOR_PROPERTY);
1709        return validationException;
1710    }
1711
1712    public static ValidationException unableToLoadClass(String JavaDoc classname, Exception JavaDoc exception) {
1713        Object JavaDoc[] args = { classname };
1714
1715        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNABLE_TO_LOAD_CLASS, args), exception);
1716        validationException.setErrorCode(UNABLE_TO_LOAD_CLASS);
1717        return validationException;
1718    }
1719
1720    public static ValidationException unfetchedAttributeNotEditable(String JavaDoc attributeName) {
1721        Object JavaDoc[] args = { attributeName };
1722
1723        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, UNFETCHED_ATTRIBUTE_NOT_EDITABLE, args));
1724        validationException.setErrorCode(UNFETCHED_ATTRIBUTE_NOT_EDITABLE);
1725        return validationException;
1726    }
1727
1728    public static ValidationException objectNeedImplTrackerForFetchGroupUsage(String JavaDoc className) {
1729        Object JavaDoc[] args = { className };
1730
1731        QueryException queryException = new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class, OBJECT_NEED_IMPL_TRACKER_FOR_FETCH_GROUP_USAGE, args));
1732        queryException.setErrorCode(OBJECT_NEED_IMPL_TRACKER_FOR_FETCH_GROUP_USAGE);
1733        return queryException;
1734    }
1735
1736    public static ValidationException wrongSequenceType(String JavaDoc typeName, String JavaDoc methodName) {
1737        Object JavaDoc[] args = { typeName, methodName };
1738        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, WRONG_SEQUENCE_TYPE, args));
1739        validationException.setErrorCode(WRONG_SEQUENCE_TYPE);
1740        return validationException;
1741    }
1742
1743    public static ValidationException cannotSetDefaultSequenceAsDefault(String JavaDoc seqName) {
1744        Object JavaDoc[] args = { seqName };
1745        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_SET_DEFAULT_SEQUENCE_AS_DEFAULT, args));
1746        validationException.setErrorCode(CANNOT_SET_DEFAULT_SEQUENCE_AS_DEFAULT);
1747        return validationException;
1748    }
1749
1750    public static ValidationException defaultSequenceNameAlreadyUsedBySequence(String JavaDoc seqName) {
1751        Object JavaDoc[] args = { seqName };
1752        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, DEFAULT_SEQUENCE_NAME_ALREADY_USED_BY_SEQUENCE, args));
1753        validationException.setErrorCode(DEFAULT_SEQUENCE_NAME_ALREADY_USED_BY_SEQUENCE);
1754        return validationException;
1755    }
1756
1757    public static ValidationException sequenceNameAlreadyUsedByDefaultSequence(String JavaDoc seqName) {
1758        Object JavaDoc[] args = { seqName };
1759        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SEQUENCE_NAME_ALREADY_USED_BY_DEFAULT_SEQUENCE, args));
1760        validationException.setErrorCode(SEQUENCE_NAME_ALREADY_USED_BY_DEFAULT_SEQUENCE);
1761        return validationException;
1762    }
1763
1764    public static ValidationException platformDoesNotSupportSequence(String JavaDoc seqName, String JavaDoc platformTypeName, String JavaDoc sequenceTypeName) {
1765        Object JavaDoc[] args = { seqName, platformTypeName, sequenceTypeName };
1766        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PLATFORM_DOES_NOT_SUPPORT_SEQUENCE, args));
1767        validationException.setErrorCode(PLATFORM_DOES_NOT_SUPPORT_SEQUENCE);
1768        return validationException;
1769    }
1770
1771    public static ValidationException sequenceCannotBeConnectedToTwoPlatforms(String JavaDoc seqName, String JavaDoc ownerPlatformName, String JavaDoc otherPlatformName) {
1772        Object JavaDoc[] args = { seqName, ownerPlatformName, otherPlatformName };
1773        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SEQUENCE_CANNOT_BE_CONNECTED_TO_TWO_PLATFORMS, args));
1774        validationException.setErrorCode(SEQUENCE_CANNOT_BE_CONNECTED_TO_TWO_PLATFORMS);
1775        return validationException;
1776    }
1777
1778    public static ValidationException querySequenceDoesNotHaveSelectQuery(String JavaDoc seqName) {
1779        Object JavaDoc[] args = { seqName };
1780        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, QUERY_SEQUENCE_DOES_NOT_HAVE_SELECT_QUERY, args));
1781        validationException.setErrorCode(QUERY_SEQUENCE_DOES_NOT_HAVE_SELECT_QUERY);
1782        return validationException;
1783    }
1784
1785    public static ValidationException createPlatformDefaultSequenceUndefined(String JavaDoc platformTypeName) {
1786        Object JavaDoc[] args = { platformTypeName };
1787        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CREATE_PLATFORM_DEFAULT_SEQUENCE_UNDEFINED, args));
1788        validationException.setErrorCode(CREATE_PLATFORM_DEFAULT_SEQUENCE_UNDEFINED);
1789        return validationException;
1790    }
1791
1792    public static ValidationException sequenceGeneratorUsingAReservedName(String JavaDoc reservedName, String JavaDoc location) {
1793        Object JavaDoc[] args = { reservedName, location };
1794        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, SEQUENCE_GENERATOR_RESERVED_NAME, args));
1795        validationException.setErrorCode(SEQUENCE_GENERATOR_RESERVED_NAME);
1796        return validationException;
1797    }
1798    
1799    public static ValidationException tableGeneratorUsingAReservedName(String JavaDoc reservedName, String JavaDoc location) {
1800        Object JavaDoc[] args = { reservedName, location };
1801        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, TABLE_GENERATOR_RESERVED_NAME, args));
1802        validationException.setErrorCode(TABLE_GENERATOR_RESERVED_NAME);
1803        return validationException;
1804    }
1805
1806    public static ValidationException onlyOneGeneratedValueIsAllowed(Class JavaDoc cls, String JavaDoc field1, String JavaDoc field2) {
1807        Object JavaDoc[] args = { cls, field1, field2 };
1808        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ONLY_ONE_GENERATED_VALURE_IS_ALLOWED, args));
1809        validationException.setErrorCode(ONLY_ONE_GENERATED_VALURE_IS_ALLOWED);
1810        return validationException;
1811    }
1812
1813    public static ValidationException wrongPropertyNameInChangeEvent(Class JavaDoc objectClass, String JavaDoc propertyName) {
1814        Object JavaDoc[] args = { objectClass, propertyName };
1815        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, WRONG_PROPERTY_NAME_IN_CHANGE_EVENT, args));
1816        validationException.setErrorCode(WRONG_PROPERTY_NAME_IN_CHANGE_EVENT);
1817        return validationException;
1818    }
1819
1820    public static ValidationException oracleOCIProxyConnectorRequiresOracleOCIConnectionPool() {
1821        Object JavaDoc[] args = { };
1822        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ORACLEOCIPROXYCONNECTOR_REQUIRES_ORACLEOCICONNECTIONPOOL, args));
1823        validationException.setErrorCode(ORACLEOCIPROXYCONNECTOR_REQUIRES_ORACLEOCICONNECTIONPOOL);
1824        return validationException;
1825    }
1826
1827    public static ValidationException oracleJDBC10_1_0_2ProxyConnectorRequiresOracleConnection() {
1828        Object JavaDoc[] args = { };
1829        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_ORACLECONNECTION, args));
1830        validationException.setErrorCode(ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_ORACLECONNECTION);
1831        return validationException;
1832    }
1833
1834    public static ValidationException oracleJDBC10_1_0_2ProxyConnectorRequiresOracleConnectionVersion() {
1835        Object JavaDoc[] args = { };
1836        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_ORACLECONNECTION_VERSION, args));
1837        validationException.setErrorCode(ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_ORACLECONNECTION_VERSION);
1838        return validationException;
1839    }
1840
1841    public static ValidationException oracleJDBC10_1_0_2ProxyConnectorRequiresIntProxytype() {
1842        Object JavaDoc[] args = { };
1843        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_INT_PROXYTYPE, args));
1844        validationException.setErrorCode(ORACLEJDBC10_1_0_2PROXYCONNECTOR_REQUIRES_INT_PROXYTYPE);
1845        return validationException;
1846    }
1847
1848    public static ValidationException couldNotFindDriverClass(Object JavaDoc driver, Exception JavaDoc ex) {
1849        Object JavaDoc[] args = { driver };
1850        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, COULD_NOT_FIND_DRIVER_CLASS, args), ex);
1851        validationException.setErrorCode(COULD_NOT_FIND_DRIVER_CLASS);
1852        return validationException;
1853    }
1854    
1855    public static ValidationException couldNotFindMapKey(String JavaDoc attributeName, Class JavaDoc entityClass, DatabaseMapping mapping) {
1856        Object JavaDoc[] args = { attributeName, entityClass, mapping };
1857        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, COULD_NOT_FIND_MAP_KEY, args));
1858        validationException.setErrorCode(COULD_NOT_FIND_MAP_KEY);
1859        return validationException;
1860    }
1861
1862    public static ValidationException errorClosingPersistenceXML(Exception JavaDoc ex) {
1863        Object JavaDoc[] args = { };
1864        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ERROR_CLOSING_PERSISTENCE_XML, args), ex);
1865        validationException.setErrorCode(ERROR_CLOSING_PERSISTENCE_XML);
1866        return validationException;
1867    }
1868    
1869    public static ValidationException configFactoryNamePropertyNotSpecified(String JavaDoc configFactory) {
1870        Object JavaDoc[] args = { configFactory };
1871        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONFIG_FACTORY_NAME_PROPERTY_NOT_SPECIFIED, args));
1872        validationException.setErrorCode(CONFIG_FACTORY_NAME_PROPERTY_NOT_SPECIFIED);
1873        return validationException;
1874    }
1875
1876    public static ValidationException configFactoryNamePropertyNotFound(String JavaDoc configClass, String JavaDoc configFactory, Exception JavaDoc ex) {
1877        Object JavaDoc[] args = { configClass, configFactory };
1878        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONFIG_FACTORY_NAME_PROPERTY_NOT_FOUND, args), ex);
1879        validationException.setErrorCode(CONFIG_FACTORY_NAME_PROPERTY_NOT_FOUND);
1880        return validationException;
1881    }
1882
1883    public static ValidationException cannotInvokeMethodOnConfigClass(String JavaDoc configMethod, String JavaDoc configClass, String JavaDoc configFactory, Exception JavaDoc ex) {
1884        Object JavaDoc[] args = { configMethod, configClass, configFactory };
1885        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_INVOKE_METHOD_ON_CONFIG_CLASS, args), ex);
1886        validationException.setErrorCode(CANNOT_INVOKE_METHOD_ON_CONFIG_CLASS);
1887        return validationException;
1888    }
1889
1890    public static ValidationException configMethodNotDefined(String JavaDoc configClass, String JavaDoc configMethod) {
1891        Object JavaDoc[] args = { configClass, configMethod };
1892        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONFIG_METHOD_NOT_DEFINED, args));
1893        validationException.setErrorCode(CONFIG_METHOD_NOT_DEFINED);
1894        return validationException;
1895    }
1896
1897   public static ValidationException conflictingSequenceAndTableGeneratorsSpecified(String JavaDoc name, String JavaDoc sequenceGeneratorLocation, String JavaDoc tableGeneratorLocation) {
1898        Object JavaDoc[] args = { name, sequenceGeneratorLocation, tableGeneratorLocation };
1899        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONFLICTING_SEQUENCE_AND_TABLE_GENERATORS_SPECIFIED, args));
1900        validationException.setErrorCode(CONFLICTING_SEQUENCE_AND_TABLE_GENERATORS_SPECIFIED);
1901        return validationException;
1902    }
1903
1904    public static ValidationException conflictingSequenceGeneratorsSpecified(String JavaDoc name, String JavaDoc location1, String JavaDoc location2) {
1905        Object JavaDoc[] args = { name, location1, location2 };
1906        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONFLICTING_SEQUENCE_GENERATORS_SPECIFIED, args));
1907        validationException.setErrorCode(CONFLICTING_SEQUENCE_GENERATORS_SPECIFIED);
1908        return validationException;
1909    }
1910    
1911    public static ValidationException conflictingSequenceNameAndTablePkColumnValueSpecified(String JavaDoc name, String JavaDoc sequenceGeneratorLocation, String JavaDoc tableGeneratorLocation) {
1912        Object JavaDoc[] args = { name, sequenceGeneratorLocation, tableGeneratorLocation };
1913        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONFLICTING_SEQUENCE_NAME_AND_TABLE_PK_COLUMN_VALUE_SPECIFIED, args));
1914        validationException.setErrorCode(CONFLICTING_SEQUENCE_NAME_AND_TABLE_PK_COLUMN_VALUE_SPECIFIED);
1915        return validationException;
1916    }
1917    
1918    public static ValidationException conflictingTableGeneratorsSpecified(String JavaDoc name, String JavaDoc location1, String JavaDoc location2) {
1919        Object JavaDoc[] args = { name, location1, location2 };
1920        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CONFLICTING_TABLE_GENERATORS_SPECIFIED, args));
1921        validationException.setErrorCode(CONFLICTING_TABLE_GENERATORS_SPECIFIED);
1922        return validationException;
1923    }
1924    
1925    public static ValidationException classListMustNotBeNull() {
1926        Object JavaDoc[] args = { };
1927        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CLASS_LIST_MUST_NOT_BE_NULL, args));
1928        validationException.setErrorCode(CLASS_LIST_MUST_NOT_BE_NULL);
1929        return validationException;
1930    }
1931
1932    public static ValidationException currentLoaderNotValid(ClassLoader JavaDoc loader) {
1933        Object JavaDoc[] args = { loader };
1934        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CURRENT_LOADER_NOT_VALID, args));
1935        validationException.setErrorCode(CURRENT_LOADER_NOT_VALID);
1936        return validationException;
1937    }
1938
1939    public static ValidationException methodFailed(String JavaDoc methodName, Exception JavaDoc ex) {
1940        Object JavaDoc[] args = { methodName };
1941        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, METHOD_FAILED, args), ex);
1942        validationException.setErrorCode(METHOD_FAILED);
1943        return validationException;
1944    }
1945    
1946    public static ValidationException missingDescriptor(String JavaDoc className) {
1947        Object JavaDoc[] args = { className };
1948
1949        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MISSING_DESCRIPTOR, args));
1950        validationException.setErrorCode(MISSING_DESCRIPTOR);
1951        return validationException;
1952    }
1953    
1954    /**
1955     * Create a validation exception for the look up of a mapping on a descriptor for an unknown attribute name. The source
1956     * is a string describing where the lookup was called from.
1957     */

1958    public static ValidationException missingMappingForAttribute(ClassDescriptor descriptor, String JavaDoc attributeName, String JavaDoc source) {
1959        Object JavaDoc[] args = { descriptor, attributeName, source };
1960
1961        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MISSING_MAPPING, args));
1962        validationException.setErrorCode(MISSING_MAPPING);
1963        return validationException;
1964    }
1965    
1966    public static ValidationException multipleCursorsNotSupported(String JavaDoc callString) {
1967        Object JavaDoc[] args = { callString };
1968
1969        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MULTIPLE_CURSORS_NOT_SUPPORTED, args));
1970        validationException.setErrorCode(MULTIPLE_CURSORS_NOT_SUPPORTED);
1971        return validationException;
1972    }
1973    
1974    public static ValidationException multipleEmbeddedIdAnnotationsFound(Class JavaDoc entityClass, String JavaDoc attributeName1, String JavaDoc attributeName2) {
1975        Object JavaDoc[] args = { entityClass, attributeName1, attributeName2 };
1976
1977        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MULTIPLE_EMBEDDED_ID_ANNOTATIONS_FOUND, args));
1978        validationException.setErrorCode(MULTIPLE_EMBEDDED_ID_ANNOTATIONS_FOUND);
1979        return validationException;
1980    }
1981
1982    public static ValidationException multipleEmbeddedIdElementsFound(Class JavaDoc entityClass, String JavaDoc attributeName1, String JavaDoc attributeName2) {
1983        Object JavaDoc[] args = { entityClass, attributeName1, attributeName2 };
1984
1985        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MULTIPLE_EMBEDDED_ID_ELEMENTS_FOUND, args));
1986        validationException.setErrorCode(MULTIPLE_EMBEDDED_ID_ELEMENTS_FOUND);
1987        return validationException;
1988    }
1989    
1990    public static ValidationException multipleLifecycleCallbackMethodsForSameLifecycleEvent(Class JavaDoc listenerClass, Method method1, Method method2) {
1991        Object JavaDoc[] args = { listenerClass, method1, method2 };
1992
1993        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MULTIPLE_CALLBACK_METHODS_DEFINED, args));
1994        validationException.setErrorCode(MULTIPLE_CALLBACK_METHODS_DEFINED);
1995        return validationException;
1996    }
1997    
1998    /**
1999     * PUBLIC:
2000     * Possible cause: More than one of projectClass, projectFile, and xmlProjectFile are specified for the same session in the TopLink.properties file.
2001     * Action: Remove one or more of the entries so that only one of the three is specified in the TopLink.properties file.
2002     */

2003    public static ValidationException multipleProjectsSpecifiedInProperties(String JavaDoc bundleName, String JavaDoc serverName) {
2004        Object JavaDoc[] args = { bundleName, serverName };
2005
2006        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MULTIPLE_PROJECTS_SPECIFIED_IN_PROPERTIES, args));
2007        validationException.setErrorCode(MULTIPLE_PROJECTS_SPECIFIED_IN_PROPERTIES);
2008        return validationException;
2009    }
2010
2011    public static ValidationException entityClassNotFound(String JavaDoc entityClass, ClassLoader JavaDoc loader, Exception JavaDoc ex) {
2012        Object JavaDoc[] args = { entityClass, loader };
2013        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, ENTITY_CLASS_NOT_FOUND, args), ex);
2014        validationException.setErrorCode(ENTITY_CLASS_NOT_FOUND);
2015        return validationException;
2016    }
2017
2018    public static ValidationException classFileTransformerThrowsException(Object JavaDoc transformer, String JavaDoc className, Exception JavaDoc ex) {
2019        Object JavaDoc[] args = { transformer, className };
2020        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CLASS_FILE_TRANSFORMER_THROWS_EXCEPTION, args), ex);
2021        validationException.setErrorCode(CLASS_FILE_TRANSFORMER_THROWS_EXCEPTION);
2022        return validationException;
2023    }
2024
2025    public static ValidationException jarFilesInPersistenceXmlNotSupported() {
2026        Object JavaDoc[] args = { };
2027        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, JAR_FILES_IN_PERSISTENCE_XML_NOT_SUPPORTED, args));
2028        validationException.setErrorCode(JAR_FILES_IN_PERSISTENCE_XML_NOT_SUPPORTED);
2029        return validationException;
2030    }
2031
2032    public static ValidationException couldNotBindJndi(String JavaDoc bindName, Object JavaDoc bindValue, Exception JavaDoc ex) {
2033        Object JavaDoc[] args = { bindName, bindValue };
2034        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, COULD_NOT_BIND_JNDI, args), ex);
2035        validationException.setErrorCode(COULD_NOT_BIND_JNDI);
2036        return validationException;
2037    }
2038
2039    public static ValidationException exceptionConfiguringEMFactory(Exception JavaDoc ex) {
2040        Object JavaDoc[] args = { };
2041        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EXCEPTION_CONFIGURING_EM_FACTORY, args), ex);
2042        validationException.setErrorCode(EXCEPTION_CONFIGURING_EM_FACTORY);
2043        return validationException;
2044    }
2045    
2046    public static ValidationException excessiveJoinColumnElementsSpecified(String JavaDoc attributeName, Class JavaDoc javaClass) {
2047        Object JavaDoc[] args = { attributeName, javaClass };
2048
2049        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EXCESSIVE_JOIN_COLUMN_ELEMENTS_SPECIFIED, args));
2050        validationException.setErrorCode(EXCESSIVE_JOIN_COLUMN_ELEMENTS_SPECIFIED);
2051        return validationException;
2052    }
2053
2054    public static ValidationException excessiveJoinColumnsSpecified(Object JavaDoc annotatedElement, Class JavaDoc javaClass) {
2055        Object JavaDoc[] args = { annotatedElement, javaClass };
2056
2057        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EXCESSIVE_JOIN_COLUMNS_SPECIFIED, args));
2058        validationException.setErrorCode(EXCESSIVE_JOIN_COLUMNS_SPECIFIED);
2059        return validationException;
2060    }
2061    
2062    public static ValidationException excessivePrimaryKeyJoinColumnElementsSpecified(Object JavaDoc annotatedElement) {
2063        Object JavaDoc[] args = { annotatedElement };
2064
2065        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EXCESSIVE_PK_JOIN_COLUMN_ELEMENTS_SPECIFIED, args));
2066        validationException.setErrorCode(EXCESSIVE_PK_JOIN_COLUMN_ELEMENTS_SPECIFIED);
2067        return validationException;
2068    }
2069    
2070    public static ValidationException excessivePrimaryKeyJoinColumnsSpecified(Object JavaDoc annotatedElement) {
2071        Object JavaDoc[] args = { annotatedElement };
2072
2073        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, EXCESSIVE_PRIMARY_KEY_JOIN_COLUMNS_SPECIFIED, args));
2074        validationException.setErrorCode(EXCESSIVE_PRIMARY_KEY_JOIN_COLUMNS_SPECIFIED);
2075        return validationException;
2076    }
2077    
2078    public static ValidationException classNotFoundWhileConvertingClassNames(String JavaDoc className, Exception JavaDoc exception) {
2079        Object JavaDoc[] args = { className };
2080        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CLASS_NOT_FOUND_WHILE_CONVERTING_CLASSNAMES, args), exception);
2081        validationException.setErrorCode(CLASS_NOT_FOUND_WHILE_CONVERTING_CLASSNAMES);
2082        return validationException;
2083    }
2084    
2085    public static ValidationException platformDoesNotOverrideGetCreateTempTableSqlPrefix(String JavaDoc className) {
2086        Object JavaDoc[] args = { className };
2087        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, PLATFORM_DOES_NOT_OVERRIDE_GETCREATETEMPTABLESQLPREFIX, args));
2088        validationException.setErrorCode(PLATFORM_DOES_NOT_OVERRIDE_GETCREATETEMPTABLESQLPREFIX);
2089        return validationException;
2090    }
2091
2092    public static ValidationException mappingAnnotationsAppliedToTransientAttribute(Object JavaDoc annotatedElement) {
2093        Object JavaDoc[] args = { annotatedElement };
2094        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MAPPING_ANNOTATIONS_APPLIED_TO_TRANSIENT_ATTRIBUTE, args));
2095        validationException.setErrorCode(MAPPING_ANNOTATIONS_APPLIED_TO_TRANSIENT_ATTRIBUTE);
2096        return validationException;
2097    }
2098    
2099    public static ValidationException mappingDoesNotOverrideValueFromRowInternalWithJoin(String JavaDoc className) {
2100        Object JavaDoc[] args = { className };
2101        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, MAPPING_DOES_NOT_OVERRIDE_VALUEFROMROWINTERNALWITHJOIN, args));
2102        validationException.setErrorCode(MAPPING_DOES_NOT_OVERRIDE_VALUEFROMROWINTERNALWITHJOIN);
2103        return validationException;
2104    }
2105    
2106    public static ValidationException cannotPersistExistingObject(Object JavaDoc registeredObject, Session session) {
2107        Vector JavaDoc key = new Vector JavaDoc();
2108        if (session != null) {
2109            key = session.keyFromObject(registeredObject);
2110        }
2111        Object JavaDoc[] args = { registeredObject, registeredObject.getClass().getName(), key, CR };
2112        
2113        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_PERSIST_MANAGED_OBJECT, args));
2114        validationException.setErrorCode(CANNOT_PERSIST_MANAGED_OBJECT);
2115        return validationException;
2116    }
2117
2118    public static ValidationException classNotListedInPersistenceUnit(String JavaDoc className) {
2119        Object JavaDoc[] args = { className };
2120        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CLASS_NOT_LISTED_IN_PERSISTENCE_UNIT, args));
2121        validationException.setErrorCode(CLASS_NOT_LISTED_IN_PERSISTENCE_UNIT);
2122        return validationException;
2123    }
2124
2125    public static ValidationException invalidMapping(Class JavaDoc entityClass, Class JavaDoc targetClass) {
2126        Object JavaDoc[] args = { entityClass, targetClass };
2127        ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INVALID_MAPPING, args));
2128        validationException.setErrorCode(INVALID_MAPPING);
2129        return validationException;
2130    }
2131
2132    public static ValidationException conflictingAccessTypeForEmbeddable(
2133            Class JavaDoc embeddableClass) {
2134        Object JavaDoc[] args = {embeddableClass };
2135        ValidationException validationException = new ValidationException(
2136                ExceptionMessageGenerator.buildMessage(
2137                        ValidationException.class,
2138                        CONFLICTNG_ACCESS_TYPE_FOR_EMBEDDABLE, args));
2139        validationException.setErrorCode(CONFLICTNG_ACCESS_TYPE_FOR_EMBEDDABLE);
2140        return validationException;
2141    }
2142
2143    public static ValidationException invalidEmbeddedAttribute(
2144            Class JavaDoc javaClass, String JavaDoc attributeName, Class JavaDoc embeddableClass) {
2145        Object JavaDoc[] args = {javaClass, attributeName, embeddableClass};
2146        ValidationException validationException = new ValidationException(
2147                ExceptionMessageGenerator.buildMessage(
2148                        ValidationException.class,
2149                        INVALID_EMBEDDED_ATTRIBUTE, args));
2150        validationException.setErrorCode(INVALID_EMBEDDED_ATTRIBUTE);
2151        return validationException;
2152    }
2153
2154    public static ValidationException bothFieldsAndPropertiesAnnotated(Class JavaDoc javaClass) {
2155        Object JavaDoc[] args = {javaClass};
2156        ValidationException validationException = new ValidationException(
2157                ExceptionMessageGenerator.buildMessage(
2158                        ValidationException.class,
2159                        BOTH_FIELDS_AND_PROPERTIES_ANNOTATED, args));
2160        validationException.setErrorCode(BOTH_FIELDS_AND_PROPERTIES_ANNOTATED);
2161        return validationException;
2162    }
2163
2164    public static ValidationException incorrectOverridingOfAccessType(
2165            Class JavaDoc javaClass, String JavaDoc xmlAccessType, String JavaDoc annotAccessType) {
2166        Object JavaDoc[] args = {javaClass, xmlAccessType, annotAccessType};
2167        ValidationException validationException = new ValidationException(
2168                ExceptionMessageGenerator.buildMessage(
2169                        ValidationException.class,
2170                        INCORRECT_OVERRIDING_OF_ACCESSTYPE, args));
2171        validationException.setErrorCode(INCORRECT_OVERRIDING_OF_ACCESSTYPE);
2172        return validationException;
2173    }
2174}
2175
Popular Tags