Index: test/schema/Positive0-jdoconfig.xml
===================================================================
--- test/schema/Positive0-jdoconfig.xml (revision 0)
+++ test/schema/Positive0-jdoconfig.xml (revision 0)
@@ -0,0 +1,245 @@
+
+
+PersistenceCapable instances without declaring them to be
@@ -69,13 +86,100 @@
*
* @version 2.1
*/
-public class JDOHelper extends Object {
-
+public class JDOHelper extends Object implements Constants {
+
+ /**
+ * A mapping from jdoconfig.xsd element attributes to PMF properties.
+ */
+ static final Map ATTRIBUTE_PROPERTY_XREF
+ = createAttributePropertyXref();
+
+ /**
+ * The standard XML schema type.
+ */
+ protected static final String XSD_TYPE
+ = "http://www.w3.org/2001/XMLSchema";
+
+ /**
+ * The JAXP schema language property.
+ */
+ protected static final String SCHEMA_LANGUAGE_PROP
+ = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+
+ /**
+ * External schema location property.
+ */
+ protected static final String SCHEMA_LOCATION_PROP
+ = "http://apache.org/xml/properties/schema/external-schemaLocation";
+
/** The Internationalization message helper.
*/
private final static I18NHelper msg =
I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N
+ /**
+ * Creates a map from jdoconfig.xsd element attributes to PMF properties.
+ * @return An unmodifiable Map of jdoconfig.xsd element attributes to PMF
+ * properties.
+ */
+ static Map createAttributePropertyXref() {
+ Map xref = new HashMap();
+
+ xref.put(
+ PMF_ATTRIBUTE_CLASS,
+ PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS);
+ xref.put(
+ PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME,
+ PROPERTY_CONNECTION_DRIVER_NAME);
+ xref.put(
+ PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME,
+ PROPERTY_CONNECTION_FACTORY_NAME);
+ xref.put(
+ PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME,
+ PROPERTY_CONNECTION_FACTORY2_NAME);
+ xref.put(
+ PMF_ATTRIBUTE_CONNECTION_PASSWORD,
+ PROPERTY_CONNECTION_PASSWORD);
+ xref.put(
+ PMF_ATTRIBUTE_CONNECTION_URL,
+ PROPERTY_CONNECTION_URL);
+ xref.put(
+ PMF_ATTRIBUTE_CONNECTION_USER_NAME,
+ PROPERTY_CONNECTION_USER_NAME);
+ xref.put(
+ PMF_ATTRIBUTE_IGNORE_CACHE,
+ PROPERTY_IGNORE_CACHE);
+ xref.put(
+ PMF_ATTRIBUTE_MAPPING,
+ PROPERTY_MAPPING);
+ xref.put(
+ PMF_ATTRIBUTE_MULTITHREADED,
+ PROPERTY_MULTITHREADED);
+ xref.put(
+ PMF_ATTRIBUTE_NONTRANSACTIONAL_READ,
+ PROPERTY_NONTRANSACTIONAL_READ);
+ xref.put(
+ PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE,
+ PROPERTY_NONTRANSACTIONAL_WRITE);
+ xref.put(
+ PMF_ATTRIBUTE_OPTIMISTIC,
+ PROPERTY_OPTIMISTIC);
+ xref.put(
+ PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME,
+ PROPERTY_PERSISTENCE_UNIT_NAME);
+ xref.put(
+ PMF_ATTRIBUTE_RESTORE_VALUES,
+ PROPERTY_RESTORE_VALUES);
+ xref.put(
+ PMF_ATTRIBUTE_RETAIN_VALUES,
+ PROPERTY_RETAIN_VALUES);
+ xref.put(
+ PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT,
+ PROPERTY_DETACH_ALL_ON_COMMIT);
+
+ return Collections.unmodifiableMap(xref);
+ }
+
/** The JDOImplHelper instance used for handling non-binary-compatible
* implementations.
*/
@@ -487,23 +591,35 @@
}
}
- /** Get a PersistenceManagerFactory based on a Properties
+ /** Get the anonymous PersistenceManagerFactory configured via the standard
+ * configuration file resource "META-INF/jdoconfig.xml", using the current thread's context class loader
+ * to locate the configuration file resource(s).
+ * @return the anonymous PersistenceManagerFactory.
+ * @since 2.1
+ * @see #getPersistenceManagerFactory(String,ClassLoader)
+ */
+ public static PersistenceManagerFactory getPersistenceManagerFactory() {
+ ClassLoader cl = getContextClassLoader();
+ return getPersistenceManagerFactory ((String)null, cl);
+ }
+
+ /** Get a PersistenceManagerFactory based on a Properties
* instance, using the current thread's context class loader to locate the
* PersistenceManagerFactory class.
* @return the PersistenceManagerFactory.
- * @param props a Properties instance with properties of the
+ * @param props a Properties instance with properties of the
* PersistenceManagerFactory.
- * @see #getPersistenceManagerFactory(Map,ClassLoader)
+ * @see #getPersistenceManagerFactory(java.util.Map,ClassLoader)
*/
public static PersistenceManagerFactory getPersistenceManagerFactory
(Map props) {
ClassLoader cl = getContextClassLoader();
return getPersistenceManagerFactory (props, cl);
}
-
+
/**
* Get a PersistenceManagerFactory based on a
- * Properties instance and a class loader.
+ * Map instance and a class loader.
* The following are standard key values:
* "javax.jdo.PersistenceManagerFactoryClass"
*
"javax.jdo.option.Optimistic",
@@ -520,8 +636,20 @@
*
"javax.jdo.option.ConnectionFactory2Name",
*
"javax.jdo.option.Mapping",
*
"javax.jdo.mapping.Catalog",
- *
"javax.jdo.mapping.Schema".
- *
JDO implementations
+ *
"javax.jdo.mapping.Schema",
+ *
"javax.jdo.option.PersistenceUnitName".
+ *
+ * and properties of the form
+ * javax.jdo.option.InstanceLifecycleListener.{listenerClass}={pcClasses}
+ * where {listenerClass} is the fully qualified name of a
+ * class that implements
+ * {@link javax.jdo.listener.InstanceLifecycleListener}, and
+ * {pcClasses} is an optional comma- or whitespace-delimited
+ * list of persistence-capable classes to be observed; the absence of a
+ * value for a property of this form means that instances of all
+ * persistence-capable classes will be observed by an instance of the given
+ * listener class.
+ *
JDO implementations
* are permitted to define key values of their own. Any key values not
* recognized by the implementation must be ignored. Key values that are
* recognized but not supported by an implementation must result in a
@@ -584,64 +712,72 @@
}
/**
- * Returns a {@link PersistenceManagerFactory} configured based
+ * Returns a named {@link PersistenceManagerFactory} with the given persistence unit name or,
+ * if not found, a {@link PersistenceManagerFactory} configured based
* on the properties stored in the resource at
- * propsResource. This method is equivalent to
+ * name. This method is equivalent to
* invoking {@link
* #getPersistenceManagerFactory(String,ClassLoader)} with
* Thread.currentThread().getContextClassLoader() as
* the loader argument.
+ * If multiple persistence units with the name given are found, a {@link JDOFatalUserException} is thrown.
* @since 2.0
- * @param propsResource the resource containing the Properties
+ * @param name the persistence unit name or resource containing the Properties
* @return the PersistenceManagerFactory
*/
public static PersistenceManagerFactory getPersistenceManagerFactory
- (String propsResource) {
- return getPersistenceManagerFactory (propsResource,
+ (String name) {
+ return getPersistenceManagerFactory (name,
getContextClassLoader());
}
/**
- * Returns a {@link PersistenceManagerFactory} configured based
+ * Returns a named {@link PersistenceManagerFactory} with the given persistence unit name or,
+ * if not found, a {@link PersistenceManagerFactory} configured based
* on the properties stored in the resource at
- * propsResource. Loads the resource via
+ * name. Loads the resource via
* loader, and creates a {@link
* PersistenceManagerFactory} with loader. Any
* IOExceptions thrown during resource loading will
* be wrapped in a {@link JDOFatalUserException}.
+ * If multiple persistence units with the name given are found, a {@link JDOFatalUserException} is thrown.
* @since 2.0
- * @param propsResource the resource containing the Properties
- * @param loader the class loader to use to load both the propsResource and
+ * @param name the persistence unit name or resource containing the Properties
+ * @param loader the class loader to use to load both the name and
* the PersistenceManagerFactory class
* @return the PersistenceManagerFactory
*/
public static PersistenceManagerFactory getPersistenceManagerFactory
- (String propsResource, ClassLoader loader) {
- return getPersistenceManagerFactory(propsResource, loader, loader);
+ (String name, ClassLoader loader) {
+ return getPersistenceManagerFactory(name, loader, loader);
}
/**
- * Returns a {@link PersistenceManagerFactory} configured based
+ * Returns a named {@link PersistenceManagerFactory} with the given
+ * persistence unit name or,
+ * if not found, a {@link PersistenceManagerFactory} configured based
* on the properties stored in the resource at
- * propsResource. Loads the Properties via
- * propsLoader, and creates a {@link
+ * name. Loads the Properties via
+ * resourceLoader, and creates a {@link
* PersistenceManagerFactory} with pmfLoader. Any
- * IOExceptions thrown during resource loading will
+ * exceptions thrown during resource loading will
* be wrapped in a {@link JDOFatalUserException}.
+ * If multiple persistence units with the requested name are found, a
+ * {@link JDOFatalUserException} is thrown.
* @since 2.0
- * @param propsResource the resource containing the Properties
- * @param propsLoader the class loader to use to load the propsResource
+ * @param name the persistence unit name or resource containing the Properties
+ * @param resourceLoader the class loader to use to load the name
* @param pmfLoader the class loader to use to load the
* PersistenceManagerFactory class
* @return the PersistenceManagerFactory
*/
public static PersistenceManagerFactory getPersistenceManagerFactory
- (String propsResource, ClassLoader propsLoader, ClassLoader pmfLoader) {
-
- if (propsResource == null)
+ (String name, ClassLoader resourceLoader, ClassLoader pmfLoader) {
+
+ if (name == null)
throw new JDOFatalUserException (msg.msg (
"EXC_GetPMFNullResource")); //NOI18N
- if (propsLoader == null)
+ if (resourceLoader == null)
throw new JDOFatalUserException (msg.msg (
"EXC_GetPMFNullPropsLoader")); //NOI18N
if (pmfLoader == null)
@@ -651,14 +787,14 @@
Properties props = new Properties ();
InputStream in = null;
try {
- in = propsLoader.getResourceAsStream (propsResource);
- if (in == null)
- throw new JDOFatalUserException (msg.msg (
- "EXC_GetPMFNoResource", propsResource, propsLoader)); //NOI18N
- props.load (in);
+ in = resourceLoader.getResourceAsStream (name);
+ if (in != null) {
+ props.load (in);
+ return getPersistenceManagerFactory (props, pmfLoader);
+ }
} catch (IOException ioe) {
throw new JDOFatalUserException (msg.msg (
- "EXC_GetPMFIOExceptionRsrc", propsResource), ioe); //NOI18N
+ "EXC_GetPMFIOExceptionRsrc", name), ioe); //NOI18N
}
finally {
if (in != null)
@@ -667,11 +803,572 @@
} catch (IOException ioe) { }
}
- return getPersistenceManagerFactory (props, pmfLoader);
+ // JDO 2.1: try to find named PMF
+ PersistenceManagerFactory pmf = getNamedPersistenceManagerFactory(
+ name == null ? "" : name.trim(),
+ resourceLoader,
+ pmfLoader
+ );
+ if (pmf != null) {
+ return pmf;
+ }
+ // else
+ throw new JDOFatalUserException (msg.msg (
+ "EXC_GetPMFNoResource", name, resourceLoader)); //NOI18N
}
+
+ /** Find and return
EntityManagerFactory cast to a
+ * {@link PersistenceManagerFactory}, or JDOCONFIG_RESOURCE_NAME.
+ *
+ * @param name The persistence unit name, or null or blank for the
+ * anonymous persistence unit.
+ * @param resourceLoader The ClassLoader used to load the standard JDO
+ * configuration file.
+ * @param pmfLoader The loader used to load the PMF implementation class.
+ * @param jdoconfigResourceName The name of the configuration file to read.
+ * In public usage, this should always be the value of
+ * {@link Constants#JDOCONFIG_RESOURCE_NAME}.
+ * @return The named PersistenceManagerFactory if found, null if not.
+ * @since 2.1
+ * @throws JDOFatalUserException if multiple persistence units are found
+ * with the given name, or any other exception is encountered.
+ */
+ protected static Map getNamedPersistenceManagerFactoryProperties(
+ String name,
+ ClassLoader resourceLoader,
+ ClassLoader pmfLoader,
+ String jdoconfigResourceName
+ ) {
+ /* JDO 2.1:
+ Attempt to find & return named persistence unit here.
+ If name == null or name == "", then we're looking for the default PMF.
+
+ If we can't find it, this method returns null.
+ */
+ name = name == null ? "" : name.trim(); // for use as key in Maps
+
+ // key is PU name, value is Map of PU properties
+ Map/*javax.persistence.EntityManagerFactory
+ * via the javax.persistence.Persistence method
+ * createEntityManagerFactory(String)
+ * and casts it to a {@link PersistenceManagerFactory}. It is a user error
+ * if his chosen JPA vendor's EntityManagerFactory
+ * implementation class does not also implement
+ * {@link PersistenceManagerFactory}.
+ * @param name The persistence unit name.
+ * @param loader The classloader used to attempt loading of the class
+ * javax.persistence.Persistence
+ * and javax.persistence.PersistenceException.
+ * @return The EntityManagerFactory, cast as a
+ * PersistenceManagerFactory for the given
+ * persistence unit name, or null if any of the following
+ * conditions are true.
+ * javax.persistence.Persistence or
+ * javax.persistence.Persistence fails for any
+ * reason.javax.persistence.Persistence method
+ * createEntityManagerFactory(String)
+ * cannot be invoked.javax.persistence.EntityManagerFactory cannot be
+ * cast to a
+ * {@link PersistenceManagerFactory}.DocumentBuilderFactory to use for XML
+ * parsing.
+ * @return a MappropsFile. This method is equivalent to
Index: src/java/javax/jdo/Constants.java
===================================================================
--- src/java/javax/jdo/Constants.java (revision 0)
+++ src/java/javax/jdo/Constants.java (revision 0)
@@ -0,0 +1,654 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package javax.jdo;
+
+/**
+ * Constant values used in JDO.
+ * @since 2.1
+ */
+public interface Constants {
+
+ /**
+ * The name of the standard JDO configuration resource file(s).
+ * @since 2.1
+ */
+ static String JDOCONFIG_RESOURCE_NAME =
+ "META-INF/jdoconfig.xml";
+
+ /**
+ * The standard JDO configuration schema namespace.
+ * @since 2.1
+ */
+ static String JDOCONFIG_XSD_NS =
+ "http://java.sun.com/xml/ns/jdo/jdoconfig";
+
+ /**
+ * The name of the persitence manager factory element in the JDO
+ * configuration file.
+ * @since 2.1
+ */
+ static String ELEMENT_PERSISTENCE_MANAGER_FACTORY
+ = "persistence-manager-factory";
+
+ /**
+ * The name of the persitence manager factory element's "class" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_CLASS
+ = "class";
+ /**
+ * The name of the persitence manager factory element's
+ * "persistence-unit-name" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME
+ = "persistence-unit-name";
+ /**
+ * The name of the persitence manager factory element's "optimistic"
+ * attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_OPTIMISTIC
+ = "optimistic";
+ /**
+ * The name of the persitence manager factory element's "retain-values"
+ * attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_RETAIN_VALUES
+ = "retain-values";
+ /**
+ * The name of the persitence manager factory element's "restore-values"
+ * attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_RESTORE_VALUES
+ = "restore-values";
+ /**
+ * The name of the persitence manager factory element's "ignore-cache"
+ * attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_IGNORE_CACHE
+ = "ignore-cache";
+ /**
+ * The name of the persitence manager factory element's
+ * "nontransactional-read" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_NONTRANSACTIONAL_READ
+ = "nontransactional-read";
+ /**
+ * The name of the persitence manager factory element's
+ * "nontransactional-write" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE
+ = "nontransactional-write";
+ /**
+ * The name of the persitence manager factory element's "multithreaded"
+ * attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_MULTITHREADED
+ = "multithreaded";
+ /**
+ * The name of the persitence manager factory element's
+ * "connection-driver-name" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME
+ = "connection-driver-name";
+ /**
+ * The name of the persitence manager factory element's
+ * "connection-user-name" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_CONNECTION_USER_NAME
+ = "connection-user-name";
+ /**
+ * The name of the persitence manager factory element's
+ * "connection-password" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_CONNECTION_PASSWORD
+ = "connection-password";
+ /**
+ * The name of the persitence manager factory element's "connection-url"
+ * attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_CONNECTION_URL
+ = "connection-url";
+ /**
+ * The name of the persitence manager factory element's "connection-factory-name" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME
+ = "connection-factory-name";
+ /**
+ * The name of the persitence manager factory element's "connection-factory2-name" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME
+ = "connection-factory2-name";
+ /**
+ * The name of the persitence manager factory element's "detach-all-on-commit" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT
+ = "detach-all-on-commit";
+ /**
+ * The name of the persitence manager factory element's "mapping" attribute.
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_MAPPING
+ = "mapping";
+
+ /**
+ * The name of the persitence manager factory property elements in the JDO
+ * configuration file.
+ */
+ static String ELEMENT_PROPERTY
+ = "property";
+ /**
+ * The name of the persitence manager factory property element's "name"
+ * attribute.
+ */
+ static String PROPERTY_ATTRIBUTE_NAME
+ = "name";
+ /**
+ * The name of the persitence manager factory property element's "value"
+ * attribute.
+ */
+ static String PROPERTY_ATTRIBUTE_VALUE
+ = "value";
+
+ /**
+ * The name of the instance lifecycle listener element in the JDO
+ * configuration file.
+ */
+ static String ELEMENT_INSTANCE_LIFECYCLE_LISTENER
+ = "instance-lifecycle-listener";
+
+ /**
+ * The name of the instance lifecycle listener element's "listener"
+ * attribute.
+ */
+ static String INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_LISTENER
+ = "listener";
+ /**
+ * The name of the instance lifecycle listener element's "classes"
+ * attribute.
+ */
+ static String INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_CLASSES
+ = "classes";
+
+ /**
+ * "javax.jdo.option.TransientTransactional"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_TRANSACTIONAL_TRANSIENT
+ = "javax.jdo.option.TransientTransactional";
+ /**
+ * "javax.jdo.option.NontransactionalRead"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_NONTRANSACTIONAL_READ
+ = "javax.jdo.option.NontransactionalRead";
+ /**
+ * "javax.jdo.option.NontransactionalWrite"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_NONTRANSACTIONAL_WRITE
+ = "javax.jdo.option.NontransactionalWrite";
+ /**
+ * "javax.jdo.option.RetainValues"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_RETAIN_VALUES
+ = "javax.jdo.option.RetainValues";
+ /**
+ * "javax.jdo.option.Optimistic"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_OPTIMISTIC
+ = "javax.jdo.option.Optimistic";
+ /**
+ * "javax.jdo.option.ApplicationIdentity"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_APPLICATION_IDENTITY
+ = "javax.jdo.option.ApplicationIdentity";
+ /**
+ * "javax.jdo.option.DatastoreIdentity"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_DATASTORE_IDENTITY
+ = "javax.jdo.option.DatastoreIdentity";
+ /**
+ * "javax.jdo.option.NonDurableIdentity"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_NONDURABLE_IDENTITY
+ = "javax.jdo.option.NonDurableIdentity";
+ /**
+ * "javax.jdo.option.ArrayList"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_ARRAYLIST
+ = "javax.jdo.option.ArrayList";
+ /**
+ * "javax.jdo.option.LinkedList"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_LINKEDLIST
+ = "javax.jdo.option.LinkedList";
+ /**
+ * "javax.jdo.option.TreeMap"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_TREEMAP
+ = "javax.jdo.option.TreeMap";
+ /**
+ * "javax.jdo.option.TreeSet"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_TREESET
+ = "javax.jdo.option.TreeSet";
+ /**
+ * "javax.jdo.option.Vector"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_VECTOR
+ = "javax.jdo.option.Vector";
+ /**
+ * "javax.jdo.option.Array"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_ARRAY
+ = "javax.jdo.option.Array";
+ /**
+ * "javax.jdo.option.NullCollection"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_NULL_COLLECTION
+ = "javax.jdo.option.NullCollection";
+ /**
+ * "javax.jdo.option.ChangeApplicationIdentity"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_CHANGE_APPLICATION_IDENTITY
+ = "javax.jdo.option.ChangeApplicationIdentity";
+ /**
+ * "javax.jdo.option.BinaryCompatibility"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_BINARY_COMPATIBILITY
+ = "javax.jdo.option.BinaryCompatibility";
+ /**
+ * "javax.jdo.option.GetDataStoreConnection"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_GET_DATASTORE_CONNECTION
+ = "javax.jdo.option.GetDataStoreConnection";
+ /**
+ * "javax.jdo.option.GetJDBCConnection"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_GET_JDBC_CONNECTION
+ = "javax.jdo.option.GetJDBCConnection";
+ /**
+ * "javax.jdo.query.SQL"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_QUERY_SQL
+ = "javax.jdo.query.SQL";
+ /**
+ * "javax.jdo.option.UnconstrainedQueryVariables"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_UNCONSTRAINED_QUERY_VARIABLES
+ = "javax.jdo.option.UnconstrainedQueryVariables";
+ /**
+ * "javax.jdo.option.version.DateTime"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_VERSION_DATETIME
+ = "javax.jdo.option.version.DateTime";
+ /**
+ * "javax.jdo.option.version.StateImage"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_VERSION_STATE_IMAGE
+ = "javax.jdo.option.version.StateImage";
+ /**
+ * "javax.jdo.option.PreDirtyEvent"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_PREDIRTY_EVENT
+ = "javax.jdo.option.PreDirtyEvent";
+ /**
+ * "javax.jdo.option.mapping.HeterogeneousObjectType"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_MAPPING_HETEROGENEOUS_OBJECT_TYPE
+ = "javax.jdo.option.mapping.HeterogeneousObjectType";
+ /**
+ * "javax.jdo.option.mapping.HeterogeneousInterfaceType"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_MAPPING_HETEROGENEOUS_INTERFACE_TYPE
+ = "javax.jdo.option.mapping.HeterogeneousInterfaceType";
+ /**
+ * "javax.jdo.option.mapping.JoinedTablePerClass"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_MAPPING_JOINED_TABLE_PER_CLASS
+ = "javax.jdo.option.mapping.JoinedTablePerClass";
+ /**
+ * "javax.jdo.option.mapping.JoinedTablePerConcreteClass"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_MAPPING_JOINED_TABLE_PER_CONCRETE_CLASS
+ = "javax.jdo.option.mapping.JoinedTablePerConcreteClass";
+ /**
+ * "javax.jdo.option.mapping.NonJoinedTablePerConcreteClass"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_MAPPING_NON_JOINED_TABLE_PER_CONCRETE_CLASS
+ = "javax.jdo.option.mapping.NonJoinedTablePerConcreteClass";
+ /**
+ * "javax.jdo.option.mapping.RelationSubclassTable"
+ * @see {@link PersistenceManagerFactory#supportedOptions()}
+ * @since 2.1
+ */
+ static String OPTION_MAPPING_RELATION_SUBCLASS_TABLE
+ = "javax.jdo.option.mapping.RelationSubclassTable";
+
+ /**
+ * "javax.jdo.PersistenceManagerFactoryClass"
+ * @see {@link JDOHelper#getPersistenceManagerFactory(java.util.Map)}
+ * @since 2.1
+ */
+ static String PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS
+ = "javax.jdo.PersistenceManagerFactoryClass";
+
+ /**
+ * "javax.jdo.option.Optimistic"
+ * @see {@link PersistenceManagerFactory#getOptimistic()}
+ * @since 2.1
+ */
+ static String PROPERTY_OPTIMISTIC
+ = "javax.jdo.option.Optimistic";
+ /**
+ * "javax.jdo.option.RetainValues"
+ * @see {@link PersistenceManagerFactory#getRetainValues()}
+ * @since 2.1
+ */
+ static String PROPERTY_RETAIN_VALUES
+ = "javax.jdo.option.RetainValues";
+ /**
+ * "javax.jdo.option.RestoreValues"
+ * @see {@link PersistenceManagerFactory#getRestoreValues()}
+ * @since 2.1
+ */
+ static String PROPERTY_RESTORE_VALUES
+ = "javax.jdo.option.RestoreValues";
+ /**
+ * "javax.jdo.option.IgnoreCache"
+ * @see {@link PersistenceManagerFactory#getIgnoreCache()}
+ * @since 2.1
+ */
+ static String PROPERTY_IGNORE_CACHE
+ = "javax.jdo.option.IgnoreCache";
+ /**
+ * "javax.jdo.option.NontransactionalRead"
+ * @see {@link PersistenceManagerFactory#getNontransactionalRead()}
+ * @since 2.1
+ */
+ static String PROPERTY_NONTRANSACTIONAL_READ
+ = "javax.jdo.option.NontransactionalRead";
+ /**
+ * "javax.jdo.option.NontransactionalWrite"
+ * @see {@link PersistenceManagerFactory#getNontransactionalWrite()}
+ * @since 2.1
+ */
+ static String PROPERTY_NONTRANSACTIONAL_WRITE
+ = "javax.jdo.option.NontransactionalWrite";
+ /**
+ * "javax.jdo.option.Multithreaded"
+ * @see {@link PersistenceManagerFactory#getMultithreaded()}
+ * @since 2.1
+ */
+ static String PROPERTY_MULTITHREADED
+ = "javax.jdo.option.Multithreaded";
+ /**
+ * "javax.jdo.option.DetachAllOnCommit"
+ * @see {@link PersistenceManagerFactory#getDetachAllOnCommit()}
+ * @since 2.1
+ */
+ static String PROPERTY_DETACH_ALL_ON_COMMIT
+ = "javax.jdo.option.DetachAllOnCommit";
+ /**
+ * "javax.jdo.option.ConnectionDriverName"
+ * @see {@link PersistenceManagerFactory#getConnectionDriverName()}
+ * @since 2.1
+ */
+ static String PROPERTY_CONNECTION_DRIVER_NAME
+ = "javax.jdo.option.ConnectionDriverName";
+ /**
+ * "javax.jdo.option.ConnectionUserName"
+ * @see {@link PersistenceManagerFactory#getConnectionUserName()}
+ * @since 2.1
+ */
+ static String PROPERTY_CONNECTION_USER_NAME
+ = "javax.jdo.option.ConnectionUserName";
+ /**
+ * "javax.jdo.option.Password"
+ * @since 2.1
+ */
+ static String PROPERTY_CONNECTION_PASSWORD
+ = "javax.jdo.option.ConnectionPassword";
+ /**
+ * "javax.jdo.option.ConnectionURL"
+ * @see {@link PersistenceManagerFactory#getConnectionURL()}
+ * @since 2.1
+ */
+ static String PROPERTY_CONNECTION_URL
+ = "javax.jdo.option.ConnectionURL";
+ /**
+ * "javax.jdo.option.ConnectionFactoryName"
+ * @see {@link PersistenceManagerFactory#getConnectionFactoryName()}
+ * @since 2.1
+ */
+ static String PROPERTY_CONNECTION_FACTORY_NAME
+ = "javax.jdo.option.ConnectionFactoryName";
+ /**
+ * "javax.jdo.option.ConnectionFactory2Name"
+ * @see {@link PersistenceManagerFactory#getConnectionFactory2Name()}
+ * @since 2.1
+ */
+ static String PROPERTY_CONNECTION_FACTORY2_NAME
+ = "javax.jdo.option.ConnectionFactory2Name";
+ /**
+ * "javax.jdo.option.Mapping"
+ * @see {@link PersistenceManagerFactory#getMapping()}
+ * @since 2.1
+ */
+ static String PROPERTY_MAPPING
+ = "javax.jdo.option.Mapping";
+ /**
+ * "javax.jdo.option.PersistenceUnitName"
+ * @see {@link PersistenceManagerFactory#getPersistenceUnitName()}
+ * @since 2.1
+ */
+ static String PROPERTY_PERSISTENCE_UNIT_NAME
+ = "javax.jdo.option.PersistenceUnitName";
+
+ /**
+ * Prefix used to configure
+ * {@link javax.jdo.listener.InstanceLifecycleListener} instances
+ * externally.
+ * To configure an InstanceLifecycleListener via properties,
+ * create a property name with the prefix of
+ * this constant and append the fully qualified listener class name, then
+ * set its value to the comma- or whitespace-delimited list
+ * of persistence-capable classes whose instances are to be observed.
+ * Use no value to indicate that instances of
+ * all persistence-capable classes are to be observed.javax.jdo.option.InstanceLifecycleListener.com.example.MyListener=com.example.Foo,com.example.Barpmf.addInstanceLifecycleListener(new com.example.MyListener(), new Class[] {com.example.Foo.class, com.example.Bar.class});pmf is an instance of type
+ * PersistenceManagerFactory.
+ * @see {@link javax.jdo.PersistenceManagerFactory#addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener,Class[])}
+ * @since 2.1
+ */
+ static String PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER
+ = "javax.jdo.option.InstanceLifecycleListener.";
+
+ /**
+ * Mapping "javax.jdo.mapping.Catalog"
+ * @since 2.1
+ */
+ static String PROPERTY_MAPPING_CATALOG
+ = "javax.jdo.mapping.Catalog";
+ /**
+ * Mapping "javax.jdo.mapping.Schema"
+ * @since 2.1
+ */
+ static String PROPERTY_MAPPING_SCHEMA
+ = "javax.jdo.mapping.Schema";
+
+ /**
+ * Nonconfigurable property constanct "VendorName"
+ * @see {@link PersistenceManagerFactory#getProperties()}
+ * @since 2.1
+ */
+ static String NONCONFIGURABLE_PROPERTY_VENDOR_NAME
+ = "VendorName";
+ /**
+ * Nonconfigurable property constanct "VersionNumber"
+ * @see {@link PersistenceManagerFactory#getProperties()}
+ * @since 2.1
+ */
+ static String NONCONFIGURABLE_PROPERTY_VERSION_NUMBER
+ = "VersionNumber";
+
+ /**
+ * The value for TransactionType to specify that transactions
+ * are managed by the Java Transactions API, as documented in
+ * JSR-220.
+ * @since 2.1
+ */
+ static String JTA = "JTA";
+
+ /**
+ * The value for TransactionType to specify that transactions
+ * are managed by the javax.jdo.Transaction instance, similar
+ * to the usage as documented in JSR-220.
+ * @since 2.1
+ */
+ static String RESOURCE_LOCAL = "RESOURCE_LOCAL";
+
+ /**
+ * The name of the resource for the DTD of the standard JDO configuration
+ * file.
+ * @since 2.1
+ */
+ static String JDOCONFIG_DTD_RESOURCE = "javax/jdo/jdoconfig_2_1.dtd";
+
+ /**
+ * The name of the resource for the XML schema of the standard JDO
+ * configuration file.
+ * @since 2.1
+ */
+ static String JDOCONFIG_XSD_RESOURCE = "javax/jdo/jdoconfig_2_1.xsd";
+
+ /**
+ * The name of the resource for the DTD of the standard JDO metadata file.
+ * @since 2.1
+ */
+ static String JDO_DTD_RESOURCE = "javax/jdo/jdo_2_0.dtd";
+
+ /**
+ * The name of the resource for the XML schema of the standard JDO
+ * metadata file.
+ * @since 2.1
+ */
+ static String JDO_XSD_RESOURCE = "javax/jdo/jdo_2_0.xsd";
+
+ /**
+ * The name of the resource for the DTD of the standard JDO
+ * object-relational mapping metadata file.
+ * @since 2.1
+ */
+ static String ORM_DTD_RESOURCE = "javax/jdo/orm_2_0.dtd";
+
+ /**
+ * The name of the resource for the XML schema of the standard JDO
+ * object-relational mapping metadata file.
+ * @since 2.1
+ */
+ static String ORM_XSD_RESOURCE = "javax/jdo/orm_2_0.xsd";
+
+ /**
+ * The name of the resource for the DTD of the standard JDO query
+ * metadata file.
+ * @since 2.1
+ */
+ static String JDOQUERY_DTD_RESOURCE = "javax/jdo/jdoquery_2_0.dtd";
+
+ /**
+ * The name of the resource for the XML schema of the standard JDO query
+ * metadata file.
+ * @since 2.1
+ */
+ static String JDOQUERY_XSD_RESOURCE = "javax/jdo/jdoquery_2_0.xsd";
+}
Index: src/java/javax/jdo/Bundle.properties
===================================================================
--- src/java/javax/jdo/Bundle.properties (revision 513879)
+++ src/java/javax/jdo/Bundle.properties (working copy)
@@ -77,3 +77,31 @@
EXC_DateStringConstructor: Error parsing Date string "{0}" at position {1} \
using date format "{2}".
MSG_unknown: unknown
+EXC_DuplicateRequestedPUFoundInDifferentConfigs: Duplicate persistence unit \
+name "{0}" found in {1} and {2}.
+EXC_DuplicateRequestedPersistenceUnitFoundInSameConfig: Duplicate persistence \
+unit name "{0}" found in {1}.
+EXC_UnableToInvokeCreateEMFMethod: Unable to invoke \
+javax.persistence.Persistence.createEntityManagerFactory(String)
+EXC_UnableToCastEMFToPMF: Unable to cast EntityManagerFactory class {0} \
+to javax.jdo.PersistenceManagerFactory
+ERR_NoDocumentBuilderFactory: Unable to instantiate \
+javax.xml.parsers.DocumentBuilderFactory
+EXC_ParserConfigException: Encountered parser configuration exception while \
+getting javax.xml.parsers.DocumentBuilder
+EXC_ParsingException: Exception parsing configuration {0}
+EXC_DuplicatePropertyFound: Duplicate property name "{0}" found in persistence \
+unit name "{1}" found in {2}.
+EXC_DuplicatePersistenceUnitNamePropertyFoundWithinUnitConfig: Duplicate \
+persistence unit name found in {2}: attribute is "{0}", element is "{1}"
+EXC_PropertyElementHasNoNameAttribute: Found