Core Java Data Objects
JDO defines two additional classes that are usable by an application:
5.5.1 JDOHelper Class
This class defines a number of static methods that a persistence-capable class or JDO application can use. Each method simply delegates to other JDO classes, like PersistenceManager and PersistenceManagerFactory , as well as classes defined in the javax.jdo.spi package like PersistenceCapable . 5.5.1.1 Method summary
This class defines methods that can be used as a bootstrap mechanism for creating a PersistenceManagerFactory instance, as well as convenience methods for interacting with persistent objects.
static PersistenceManager getPersistenceManager (Object pc) This method returns the PersistenceManager instance associated with the specified object. It returns null if the specified instance is transient or is not an instance of a persistence-capable class.
static PersistenceManagerFactory getPersistenceManagerFactory (Properties props) static PersistenceManagerFactory getPersistenceManagerFactory (Properties props, ClassLoader cl) These methods create a PersistenceManagerFactory instance based on the specified properties. See the section on PersistenceManagerFactory for more details on each property. If no class loader is specified, then the calling thread's context ClassLoader is used to find the PersistenceManagerFactory class. Table 5-9 provides a list of the standard properties that can be used. The only required property is javax.jdo.PersistenceManagerFactoryClass . All others are optional. In addition to these standard properties, a JDO implementation may also support its own additional properties. Any properties not recognized by a JDO implementation are ignored. Table 5-9. JDOHelper Properties
[*] The value of this property is specific to the JDO implementation being used.
5.5.2 I18NHelper class
This class provides localized strings for the classes in the javax.jdo and javax.jdo.spi packages (primarily the exception classes). It finds a Java ResourceBundle for the current locale using java.jdo.Bundle as the baseclass. If no ResourceBundle is found for the current locale, then the Bundle.properties file located in the javax.jdo package is used. If an application needed to provide localized strings, it could provide its own ResourceBundle . Although this class is in the javax.jdo package, it is not supposed to be used by an application. As of the JDO 1.0.1 maintenance release, this class has been deprecated and in future releases will be moved to the javax.jdo.spi package. |