org.xorm
Class XORM

java.lang.Object
  |
  +--org.xorm.XORM
All Implemented Interfaces:
I15d

public class XORM
extends Object
implements I15d

XORM helper class to instantiate objects and access XORM-specific features.


Field Summary
static String XORM_PROPERTIES
          The System property that the no-argument newPersistenceManagerFactory() method reads.
 
Fields inherited from interface org.xorm.I15d
I18N
 
Constructor Summary
XORM()
           
 
Method Summary
static void clearCache(PersistenceManagerFactory factory)
          Clears all data from the factory-wide cache.
static Class extractClass(Object objectId)
          Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the class of the object.
static Object extractPrimaryKey(Object objectId)
          Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the datastore primary key.
static int extractPrimaryKeyAsInt(Object objectId)
          Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the datastore primary key.
static long extractPrimaryKeyAsLong(Object objectId)
          Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the datastore primary key.
static DataSource getDataSource(PersistenceManagerFactory factory)
          Returns the data source in use by the PersistenceManagerFactory.
static FetchGroupManager getFetchGroupManager(PersistenceManager mgr)
          Returns the FetchGroupManager associated with the given persistence manager.
static ModelMapping getModelMapping(PersistenceManager mgr)
          Returns the ModelMapping associated with the given manager's factory.
static ModelMapping getModelMapping(PersistenceManagerFactory factory)
          Returns the ModelMapping associated with the given factory.
static String getVersion()
           
static void main(String[] argv)
           
static Object newInstance(PersistenceManager mgr, Class mappedClass)
          Creates a new instance managed by the given PersistenceManager and implementing the interface of the given interface class.
static Object newInstance(PersistenceManagerFactory factory, Class mappedClass)
          Creates a new instance managed by the given PersistenceManager and implementing the interface of the given interface class.
static ObjectId newObjectId(Class mappedClass, int id)
          Creates an instance of a datastore identity that can be used in PersistenceManager.getObjectById().
static ObjectId newObjectId(Class mappedClass, long id)
          Creates an instance of a datastore identity that can be used in PersistenceManager.getObjectById().
static ObjectId newObjectId(Class mappedClass, Object id)
          Creates an instance of a datastore identity that can be used in PersistenceManager.getObjectById().
static PersistenceManagerFactory newPersistenceManagerFactory()
          Construct a factory using the setting of the system property "xorm.properties" (the constant defined here as XORM_PROPERTIES) to reference a properties file.
static PersistenceManagerFactory newPersistenceManagerFactory(ClassLoader loader)
          Construct a factory using the Java system property "xorm.properties" to find a properties file.
static PersistenceManagerFactory newPersistenceManagerFactory(InputStream propertiesInputStream)
          Creates a PersistenceManagerFactory using the standard JDO properties.
static PersistenceManagerFactory newPersistenceManagerFactory(InputStream propertiesInputStream, ClassLoader loader)
          Creates a PersistenceManagerFactory using the standard JDO properties and the specified ClassLoader.
static PersistenceManagerFactory newPersistenceManagerFactory(Properties properties)
          Creates a PersistenceManagerFactory using a passed in Properties object.
static PersistenceManagerFactory newPersistenceManagerFactory(Properties properties, ClassLoader loader)
          Creates a PersistenceManagerFactory using a passed in Properties object and the specified ClassLoader.
static PersistenceManagerFactory newPersistenceManagerFactory(String propertiesFilename)
          Creates a PersistenceManagerFactory using the standard JDO properties.
static PersistenceManagerFactory newPersistenceManagerFactory(String propertiesFilename, ClassLoader loader)
          Creates a PersistenceManagerFactory using the standard JDO properties and the specified ClassLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XORM_PROPERTIES

public static final String XORM_PROPERTIES
The System property that the no-argument newPersistenceManagerFactory() method reads.

See Also:
Constant Field Values
Constructor Detail

XORM

public XORM()
Method Detail

newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory()
Construct a factory using the setting of the system property "xorm.properties" (the constant defined here as XORM_PROPERTIES) to reference a properties file. The current thread's ClassLoader is used.


newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory(ClassLoader loader)
Construct a factory using the Java system property "xorm.properties" to find a properties file. It can refer to either a filename or a classpath resource.


newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory(String propertiesFilename)
Creates a PersistenceManagerFactory using the standard JDO properties.


newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory(String propertiesFilename,
                                                                     ClassLoader loader)
Creates a PersistenceManagerFactory using the standard JDO properties and the specified ClassLoader.


newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory(InputStream propertiesInputStream)
Creates a PersistenceManagerFactory using the standard JDO properties.


newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory(InputStream propertiesInputStream,
                                                                     ClassLoader loader)
Creates a PersistenceManagerFactory using the standard JDO properties and the specified ClassLoader.


newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory(Properties properties)
Creates a PersistenceManagerFactory using a passed in Properties object.


newPersistenceManagerFactory

public static PersistenceManagerFactory newPersistenceManagerFactory(Properties properties,
                                                                     ClassLoader loader)
Creates a PersistenceManagerFactory using a passed in Properties object and the specified ClassLoader.


newInstance

public static Object newInstance(PersistenceManager mgr,
                                 Class mappedClass)
Creates a new instance managed by the given PersistenceManager and implementing the interface of the given interface class.


newInstance

public static Object newInstance(PersistenceManagerFactory factory,
                                 Class mappedClass)
Creates a new instance managed by the given PersistenceManager and implementing the interface of the given interface class.


newObjectId

public static ObjectId newObjectId(Class mappedClass,
                                   int id)
Creates an instance of a datastore identity that can be used in PersistenceManager.getObjectById().


newObjectId

public static ObjectId newObjectId(Class mappedClass,
                                   long id)
Creates an instance of a datastore identity that can be used in PersistenceManager.getObjectById().


newObjectId

public static ObjectId newObjectId(Class mappedClass,
                                   Object id)
Creates an instance of a datastore identity that can be used in PersistenceManager.getObjectById().


extractPrimaryKey

public static Object extractPrimaryKey(Object objectId)
Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the datastore primary key. This is the inverse of the newObjectId() operation.


extractPrimaryKeyAsInt

public static int extractPrimaryKeyAsInt(Object objectId)
Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the datastore primary key. This is the inverse of the newObjectId() operation.


extractPrimaryKeyAsLong

public static long extractPrimaryKeyAsLong(Object objectId)
Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the datastore primary key. This is the inverse of the newObjectId() operation.


extractClass

public static Class extractClass(Object objectId)
Takes an object ID as returned by PersistenceManager.getObjectId() or JDOHelper.getObjectId() and returns the portion that refers to the class of the object. This is the inverse of the newObjectId() operation.


getModelMapping

public static ModelMapping getModelMapping(PersistenceManager mgr)
Returns the ModelMapping associated with the given manager's factory. Throws JDOFatalUserException if it is invoked on a non-XORM manager.


getModelMapping

public static ModelMapping getModelMapping(PersistenceManagerFactory factory)
Returns the ModelMapping associated with the given factory. Throws JDOFatalUserException if it is invoked on a non-XORM factory.


getFetchGroupManager

public static FetchGroupManager getFetchGroupManager(PersistenceManager mgr)
Returns the FetchGroupManager associated with the given persistence manager.


clearCache

public static void clearCache(PersistenceManagerFactory factory)
Clears all data from the factory-wide cache.


getDataSource

public static DataSource getDataSource(PersistenceManagerFactory factory)
Returns the data source in use by the PersistenceManagerFactory. This allows you to acquire native JDBC connections to use alongside JDO.


getVersion

public static String getVersion()

main

public static void main(String[] argv)


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/XORM.html,v 1.8 2004/05/30 08:55:03 wbiggs Exp $