com.orientechnologies.jdo
Class oPersistenceManagerFactory

java.lang.Object
  extended bycom.orientechnologies.jdo.oPersistenceManagerFactory
All Implemented Interfaces:
PersistenceManagerFactory, java.io.Serializable

public class oPersistenceManagerFactory
extends java.lang.Object
implements PersistenceManagerFactory

See Also:
Serialized Form

Constructor Summary
oPersistenceManagerFactory()
           
oPersistenceManagerFactory(java.util.Properties iProp)
           
 
Method Summary
 void close()
          Close this PersistenceManagerFactory.
 void finalize()
           
 java.lang.String getConnectionDriverName()
          Get the driver name for the data store connection.
 java.lang.Object getConnectionFactory()
          Get the data store connection factory.
 java.lang.Object getConnectionFactory2()
          Get the second data store connection factory.
 java.lang.String getConnectionFactory2Name()
          Get the name for the second data store connection factory.
 java.lang.String getConnectionFactoryName()
          Get the name for the data store connection factory.
 java.lang.String getConnectionURL()
          Get the URL for the data store connection.
 java.lang.String getConnectionUserName()
          Get the user name for the data store connection.
 boolean getIgnoreCache()
          Get the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
 int getMaxPool()
           
 int getMinPool()
           
 int getMsWait()
           
 boolean getMultithreaded()
          Get the default Multithreaded setting for all PersistenceManager instances obtained from this factory.
 boolean getNontransactionalRead()
          Get the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.
 boolean getNontransactionalWrite()
          Get the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.
 boolean getOptimistic()
          Get the default Optimistic setting for all PersistenceManager instances obtained from this factory.
 PersistenceManager getPersistenceManager()
          Get an instance of PersistenceManager from this factory.
 PersistenceManager getPersistenceManager(java.lang.String iUserName, java.lang.String iUserPasswd)
          Get an instance of PersistenceManager from this factory.
 PersistenceManager getPersistenceManager(java.lang.String iUrl, java.lang.String iUserName, java.lang.String iUserPasswd)
          Create Persistence Manager from parameters given.
static PersistenceManagerFactory getPersistenceManagerFactory()
           
static PersistenceManagerFactory getPersistenceManagerFactory(java.util.Properties iProp)
           
 java.util.Properties getProperties()
          Return non-configurable properties of this PersistenceManagerFactory.
 boolean getRestoreValues()
          Get the default value for the RestoreValues property.
 boolean getRetainValues()
          Get the default RetainValues setting for all PersistenceManager instances obtained from this factory.
 void init()
           
 void setConnectionDriverName(java.lang.String parm1)
          Set the driver name for the data store connection.
 void setConnectionFactory(java.lang.Object parm1)
          Set the data store connection factory.
 void setConnectionFactory2(java.lang.Object p0)
          Set the second data store connection factory.
 void setConnectionFactory2Name(java.lang.String p0)
          Set the name for the second data store connection factory.
 void setConnectionFactoryName(java.lang.String parm1)
          Set the name for the data store connection factory.
 void setConnectionPassword(java.lang.String iUserPasswd)
          Set the password for the data store connection.
 void setConnectionURL(java.lang.String iURL)
          Set the URL for the data store connection.
 void setConnectionUserName(java.lang.String iUserName)
          Set the user name for the data store connection.
 void setIgnoreCache(boolean iValue)
          Set the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
 void setMaxPool(int p0)
           
 void setMinPool(int p0)
           
 void setMsWait(int p0)
           
 void setMultithreaded(boolean iMT)
          Set the default Multithreaded setting for all PersistenceManager instances obtained from this factory.
 void setNontransactionalRead(boolean parm1)
          Set the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.
 void setNontransactionalWrite(boolean p0)
          Set the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.
 void setOptimistic(boolean iValue)
          Set the default Optimistic setting for all PersistenceManager instances obtained from this factory.
 void setRestoreValues(boolean boolean0)
          Set the default value for the RestoreValues property.
 void setRetainValues(boolean iValue)
          Set the default RetainValues setting for all PersistenceManager instances obtained from this factory.
 java.util.Collection supportedOptions()
          The application can determine from the results of this method which optional features, and which query languages are supported by the JDO implementation.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

oPersistenceManagerFactory

public oPersistenceManagerFactory()

oPersistenceManagerFactory

public oPersistenceManagerFactory(java.util.Properties iProp)
Method Detail

init

public void init()

finalize

public void finalize()

close

public void close()
Description copied from interface: PersistenceManagerFactory
Close this PersistenceManagerFactory. Check for JDOPermission("closePersistenceManagerFactory") and if not authorized, throw SecurityException.

If the authorization check succeeds, check to see that all PersistenceManager instances obtained from this PersistenceManagerFactory have no active transactions. If any PersistenceManager instances have an active transaction, throw a JDOUserException, with one nested JDOUserException for each PersistenceManager with an active Transaction.

If there are no active transactions, then close all PersistenceManager instances obtained from this PersistenceManagerFactory, mark this PersistenceManagerFactory as closed, disallow getPersistenceManager methods, and allow all other get methods. If a set method or getPersistenceManager method is called after close, then JDOUserException is thrown.

Specified by:
close in interface PersistenceManagerFactory

getConnectionDriverName

public java.lang.String getConnectionDriverName()
Description copied from interface: PersistenceManagerFactory
Get the driver name for the data store connection.

Specified by:
getConnectionDriverName in interface PersistenceManagerFactory
Returns:
the driver name for the data store connection.

getConnectionFactory

public java.lang.Object getConnectionFactory()
Description copied from interface: PersistenceManagerFactory
Get the data store connection factory.

Specified by:
getConnectionFactory in interface PersistenceManagerFactory
Returns:
the data store connection factory.

getConnectionFactoryName

public java.lang.String getConnectionFactoryName()
Description copied from interface: PersistenceManagerFactory
Get the name for the data store connection factory.

Specified by:
getConnectionFactoryName in interface PersistenceManagerFactory
Returns:
the name of the data store connection factory.

setConnectionFactory2Name

public void setConnectionFactory2Name(java.lang.String p0)
Description copied from interface: PersistenceManagerFactory
Set the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.

Specified by:
setConnectionFactory2Name in interface PersistenceManagerFactory
Parameters:
p0 - the name of the data store connection factory.

getConnectionFactory2Name

public java.lang.String getConnectionFactory2Name()
Description copied from interface: PersistenceManagerFactory
Get the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.

Specified by:
getConnectionFactory2Name in interface PersistenceManagerFactory
Returns:
the name of the data store connection factory.

setConnectionFactory2

public void setConnectionFactory2(java.lang.Object p0)
Description copied from interface: PersistenceManagerFactory
Set the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions. JDO implementations will support specific connection factories. The connection factory interfaces are not part of the JDO specification.

Specified by:
setConnectionFactory2 in interface PersistenceManagerFactory
Parameters:
p0 - the data store connection factory.

getConnectionFactory2

public java.lang.Object getConnectionFactory2()
Description copied from interface: PersistenceManagerFactory
Get the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.

Specified by:
getConnectionFactory2 in interface PersistenceManagerFactory
Returns:
the data store connection factory.

getConnectionURL

public java.lang.String getConnectionURL()
Description copied from interface: PersistenceManagerFactory
Get the URL for the data store connection.

Specified by:
getConnectionURL in interface PersistenceManagerFactory
Returns:
the URL for the data store connection.

getConnectionUserName

public java.lang.String getConnectionUserName()
Description copied from interface: PersistenceManagerFactory
Get the user name for the data store connection.

Specified by:
getConnectionUserName in interface PersistenceManagerFactory
Returns:
the user name for the data store connection.

getIgnoreCache

public boolean getIgnoreCache()
Description copied from interface: PersistenceManagerFactory
Get the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.

Specified by:
getIgnoreCache in interface PersistenceManagerFactory
Returns:
the default IngoreCache setting.

getNontransactionalRead

public boolean getNontransactionalRead()
Description copied from interface: PersistenceManagerFactory
Get the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.

Specified by:
getNontransactionalRead in interface PersistenceManagerFactory
Returns:
the default NontransactionalRead setting.

getNontransactionalWrite

public boolean getNontransactionalWrite()
Description copied from interface: PersistenceManagerFactory
Get the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.

Specified by:
getNontransactionalWrite in interface PersistenceManagerFactory
Returns:
the default NontransactionalWrite setting.

setNontransactionalWrite

public void setNontransactionalWrite(boolean p0)
Description copied from interface: PersistenceManagerFactory
Set the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.

Specified by:
setNontransactionalWrite in interface PersistenceManagerFactory
Parameters:
p0 - the default NontransactionalWrite setting.

getOptimistic

public boolean getOptimistic()
Description copied from interface: PersistenceManagerFactory
Get the default Optimistic setting for all PersistenceManager instances obtained from this factory.

Specified by:
getOptimistic in interface PersistenceManagerFactory
Returns:
the default Optimistic setting.

getPersistenceManager

public PersistenceManager getPersistenceManager()
Description copied from interface: PersistenceManagerFactory
Get an instance of PersistenceManager from this factory. The instance has default values for options.

After the first use of getPersistenceManager, no "set" methods will succeed.

Specified by:
getPersistenceManager in interface PersistenceManagerFactory
Returns:
a PersistenceManager instance with default options.

getPersistenceManager

public PersistenceManager getPersistenceManager(java.lang.String iUserName,
                                                java.lang.String iUserPasswd)
Description copied from interface: PersistenceManagerFactory
Get an instance of PersistenceManager from this factory. The instance has default values for options. The parameters userid and password are used when obtaining datastore connections from the connection pool.

After the first use of getPersistenceManager, no "set" methods will succeed.

Specified by:
getPersistenceManager in interface PersistenceManagerFactory
Parameters:
iUserName - the userid for the connection
iUserPasswd - the password for the connection
Returns:
a PersistenceManager instance with default options.

getPersistenceManager

public PersistenceManager getPersistenceManager(java.lang.String iUrl,
                                                java.lang.String iUserName,
                                                java.lang.String iUserPasswd)
                                         throws JDOException
Create Persistence Manager from parameters given.

Parameters:
iUrl - Database URL
iUserName - User name
iUserPasswd - User password
Returns:
On succed the new PersistenceManager created, else null
Throws:
JDOException

getPersistenceManagerFactory

public static PersistenceManagerFactory getPersistenceManagerFactory(java.util.Properties iProp)

getPersistenceManagerFactory

public static PersistenceManagerFactory getPersistenceManagerFactory()

getProperties

public java.util.Properties getProperties()
Description copied from interface: PersistenceManagerFactory
Return non-configurable properties of this PersistenceManagerFactory. Properties with keys VendorName and VersionNumber are required. Other keys are optional.

Specified by:
getProperties in interface PersistenceManagerFactory
Returns:
the non-configurable properties of this PersistenceManagerFactory.

getRetainValues

public boolean getRetainValues()
Description copied from interface: PersistenceManagerFactory
Get the default RetainValues setting for all PersistenceManager instances obtained from this factory.

Specified by:
getRetainValues in interface PersistenceManagerFactory
Returns:
the default RetainValues setting.

setRestoreValues

public void setRestoreValues(boolean boolean0)
Description copied from interface: PersistenceManagerFactory
Set the default value for the RestoreValues property. If true, at rollback, fields of newly persistent instances are restored to their values as of the beginning of the transaction, and the instances revert to transient. Additionally, fields of modified instances of primitive types and immutable reference types are restored to their values as of the beginning of the transaction.

If false, at rollback, the values of fields of newly persistent instances are unchanged and the instances revert to transient. Additionally, dirty instances transition to hollow. If an implementation does not support this option, a JDOUnsupportedOptionException is thrown.

Specified by:
setRestoreValues in interface PersistenceManagerFactory
Parameters:
boolean0 - the value of the restoreValues property

getRestoreValues

public boolean getRestoreValues()
Description copied from interface: PersistenceManagerFactory
Get the default value for the RestoreValues property.

Specified by:
getRestoreValues in interface PersistenceManagerFactory
Returns:
the value of the restoreValues property

setConnectionDriverName

public void setConnectionDriverName(java.lang.String parm1)
Description copied from interface: PersistenceManagerFactory
Set the driver name for the data store connection.

Specified by:
setConnectionDriverName in interface PersistenceManagerFactory
Parameters:
parm1 - the driver name for the data store connection.

setConnectionFactory

public void setConnectionFactory(java.lang.Object parm1)
Description copied from interface: PersistenceManagerFactory
Set the data store connection factory. JDO implementations will support specific connection factories. The connection factory interfaces are not part of the JDO specification.

Specified by:
setConnectionFactory in interface PersistenceManagerFactory
Parameters:
parm1 - the data store connection factory.

setConnectionFactoryName

public void setConnectionFactoryName(java.lang.String parm1)
Description copied from interface: PersistenceManagerFactory
Set the name for the data store connection factory.

Specified by:
setConnectionFactoryName in interface PersistenceManagerFactory
Parameters:
parm1 - the name of the data store connection factory.

setConnectionPassword

public void setConnectionPassword(java.lang.String iUserPasswd)
Description copied from interface: PersistenceManagerFactory
Set the password for the data store connection.

Specified by:
setConnectionPassword in interface PersistenceManagerFactory
Parameters:
iUserPasswd - the password for the data store connection.

setConnectionURL

public void setConnectionURL(java.lang.String iURL)
Description copied from interface: PersistenceManagerFactory
Set the URL for the data store connection.

Specified by:
setConnectionURL in interface PersistenceManagerFactory
Parameters:
iURL - the URL for the data store connection.

setConnectionUserName

public void setConnectionUserName(java.lang.String iUserName)
Description copied from interface: PersistenceManagerFactory
Set the user name for the data store connection.

Specified by:
setConnectionUserName in interface PersistenceManagerFactory
Parameters:
iUserName - the user name for the data store connection.

setIgnoreCache

public void setIgnoreCache(boolean iValue)
Description copied from interface: PersistenceManagerFactory
Set the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.

Specified by:
setIgnoreCache in interface PersistenceManagerFactory
Parameters:
iValue - the default IgnoreCache setting.

setNontransactionalRead

public void setNontransactionalRead(boolean parm1)
Description copied from interface: PersistenceManagerFactory
Set the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.

Specified by:
setNontransactionalRead in interface PersistenceManagerFactory
Parameters:
parm1 - the default NontransactionalRead setting.

setOptimistic

public void setOptimistic(boolean iValue)
Description copied from interface: PersistenceManagerFactory
Set the default Optimistic setting for all PersistenceManager instances obtained from this factory.

Specified by:
setOptimistic in interface PersistenceManagerFactory
Parameters:
iValue - the default Optimistic setting.

setRetainValues

public void setRetainValues(boolean iValue)
Description copied from interface: PersistenceManagerFactory
Set the default RetainValues setting for all PersistenceManager instances obtained from this factory.

Specified by:
setRetainValues in interface PersistenceManagerFactory
Parameters:
iValue - the default RetainValues setting.

getMaxPool

public int getMaxPool()

setMaxPool

public void setMaxPool(int p0)

getMinPool

public int getMinPool()

setMinPool

public void setMinPool(int p0)

getMsWait

public int getMsWait()

setMsWait

public void setMsWait(int p0)

getMultithreaded

public boolean getMultithreaded()
Description copied from interface: PersistenceManagerFactory
Get the default Multithreaded setting for all PersistenceManager instances obtained from this factory.

Specified by:
getMultithreaded in interface PersistenceManagerFactory
Returns:
the default Multithreaded setting.

setMultithreaded

public void setMultithreaded(boolean iMT)
Description copied from interface: PersistenceManagerFactory
Set the default Multithreaded setting for all PersistenceManager instances obtained from this factory.

Specified by:
setMultithreaded in interface PersistenceManagerFactory
Parameters:
iMT - the default Multithreaded setting.

supportedOptions

public java.util.Collection supportedOptions()
Description copied from interface: PersistenceManagerFactory
The application can determine from the results of this method which optional features, and which query languages are supported by the JDO implementation.

Each supported JDO optional feature is represented by a String with one of the following values:

javax.jdo.option.TransientTransactional
javax.jdo.option.NontransactionalRead
javax.jdo.option.NontransactionalWrite
javax.jdo.option.RetainValues
javax.jdo.option.Optimistic
javax.jdo.option.ApplicationIdentity
javax.jdo.option.DatastoreIdentity
javax.jdo.option.NonDatastoreIdentity
javax.jdo.option.ArrayList
javax.jdo.option.HashMap
javax.jdo.option.Hashtable
javax.jdo.option.LinkedList
javax.jdo.option.TreeMap
javax.jdo.option.TreeSet
javax.jdo.option.Vector
javax.jdo.option.Map
javax.jdo.option.List
javax.jdo.option.Array
javax.jdo.option.NullCollection

The standard JDO query language is represented by a String:

javax.jdo.query.JDOQL

Specified by:
supportedOptions in interface PersistenceManagerFactory
Returns:
the List of Strings representing the supported options.