Interface PersistenceManagerFactory
-
- All Superinterfaces:
Serializable
public interface PersistenceManagerFactory extends Serializable
ThePersistenceManagerFactoryis the interface to use to obtainPersistenceManagerinstances. AllPersistenceManagerinstances obtained from the samePersistenceManagerFactorywill have the same default properties.PersistenceManagerFactoryinstances may be configured and serialized for later use. They may be stored via JNDI and looked up and used later. Any properties configured will be saved and restored.Once the first
PersistenceManageris obtained from thePersistenceManagerFactory, the factory can no longer be configured.If the
ConnectionFactoryproperty is set (non-null) then all other Connection properties includingConnectionFactoryNameare ignored; otherwise, ifConnectionFactoryNameis set (non-null) then all other Connection properties are ignored. Similarly, if theConnectionFactory2property is set (non-null) thenConnectionFactory2Nameis ignored.Operational state (
PersistenceManagerpooling, connection pooling, operational parameters) must not be serialized.- Version:
- 2.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFetchGroups(FetchGroup... groups)Add theFetchGroups to the set of active fetch groups.voidaddInstanceLifecycleListener(InstanceLifecycleListener listener, Class[] classes)Add the parameter listener to the list of instance lifecycle event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory.voidclose()Close this PersistenceManagerFactory.StringgetConnectionDriverName()Get the driver name for the data store connection.ObjectgetConnectionFactory()Get the data store connection factory.ObjectgetConnectionFactory2()Get the second data store connection factory.StringgetConnectionFactory2Name()Get the name for the second data store connection factory.StringgetConnectionFactoryName()Get the name for the data store connection factory.StringgetConnectionURL()Get the URL for the data store connection.StringgetConnectionUserName()Get the user name for the data store connection.booleangetCopyOnAttach()Gets the default copyOnAttach setting for allPersistenceManagerinstances obtained from this factory.DataStoreCachegetDataStoreCache()Return theDataStoreCachethat this factory uses for controlling a second-level cache.IntegergetDatastoreReadTimeoutMillis()Get the default timeout setting for read operations.IntegergetDatastoreWriteTimeoutMillis()Get the default timeout setting for write operations.booleangetDetachAllOnCommit()Gets the detachAllOnCommit setting.FetchGroupgetFetchGroup(Class cls, String name)Create an unscoped, modifiableFetchGroupfor the Class and name.SetgetFetchGroups()Get a modifiable Set containing a mutable copy of all currently active (in scope) fetch groups.booleangetIgnoreCache()Get the default IgnoreCache setting for allPersistenceManagerinstances obtained from this factory.Collection<Class>getManagedClasses()Method to return the currently managed classes for this factory.StringgetMapping()Get the Mapping setting for this factory.TypeMetadatagetMetadata(String className)Method to return the metadata object for the specified class/interface, if there is metadata defined for that class/interface.booleangetMultithreaded()Get the default Multithreaded setting for allPersistenceManagerinstances obtained from this factory.StringgetName()Gets the name of this PersistenceManagerFactory.booleangetNontransactionalRead()Get the default NontransactionalRead setting for allPersistenceManagerinstances obtained from this factory.booleangetNontransactionalWrite()Get the default NontransactionalWrite setting for allPersistenceManagerinstances obtained from this factory.booleangetOptimistic()Get the default Optimistic setting for allPersistenceManagerinstances obtained from this factory.PersistenceManagergetPersistenceManager()Get an instance ofPersistenceManagerfrom this factory.PersistenceManagergetPersistenceManager(String userid, String password)Get an instance ofPersistenceManagerfrom this factory.PersistenceManagergetPersistenceManagerProxy()Get a thread-safe instance of a proxy that dynamically binds on each method call to an instance ofPersistenceManager.StringgetPersistenceUnitName()Gets the PersistenceUnitName for this PersistenceManagerFactory.PropertiesgetProperties()Return non-configurable properties of thisPersistenceManagerFactory.booleangetReadOnly()Gets the value for read-only for this PMF.booleangetRestoreValues()Get the default value for the RestoreValues property.booleangetRetainValues()Get the default RetainValues setting for allPersistenceManagerinstances obtained from this factory.StringgetServerTimeZoneID()Gets the TimeZone ID of the server associated with this PersistenceManagerFactory.StringgetTransactionIsolationLevel()Get the value for transaction isolation level for this PMF.StringgetTransactionType()Gets the TransactionType for this PersistenceManagerFactory.booleanisClosed()APersistenceManagerFactoryinstance can be used until it is closed.JDOMetadatanewMetadata()Method to return a new metadata object that can be subsequently modified and registered with the persistence process using the methodregisterMetadata(javax.jdo.metadata.JDOMetadata).voidregisterMetadata(JDOMetadata metadata)Method to register metadata with the persistence process managed by thisPersistenceManagerFactory.voidremoveAllFetchGroups()Remove allFetchGroups from the set of activeFetchGroups.voidremoveFetchGroups(FetchGroup... groups)Remove theFetchGroups from the set of activeFetchGroups.voidremoveInstanceLifecycleListener(InstanceLifecycleListener listener)Remove the parameter listener instance from the list of instance lifecycle event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory.voidsetConnectionDriverName(String driverName)Set the driver name for the data store connection.voidsetConnectionFactory(Object connectionFactory)Set the data store connection factory.voidsetConnectionFactory2(Object connectionFactory)Set the second data store connection factory.voidsetConnectionFactory2Name(String connectionFactoryName)Set the name for the second data store connection factory.voidsetConnectionFactoryName(String connectionFactoryName)Set the name for the data store connection factory.voidsetConnectionPassword(String password)Set the password for the data store connection.voidsetConnectionURL(String url)Set the URL for the data store connection.voidsetConnectionUserName(String userName)Set the user name for the data store connection.voidsetCopyOnAttach(boolean flag)Sets the default copyOnAttach setting for allPersistenceManagerinstances obtained from this factory.voidsetDatastoreReadTimeoutMillis(Integer interval)Specify a default timeout interval (milliseconds) for any read operations for persistence managers obtained from this persistence manager factory.voidsetDatastoreWriteTimeoutMillis(Integer interval)Specify a default timeout interval (milliseconds) for any write operations for persistence managers obtained from this persistence manager factory.voidsetDetachAllOnCommit(boolean flag)Sets the default detachAllOnCommit setting for allPersistenceManagerinstances obtained from this factory.voidsetIgnoreCache(boolean flag)Set the default IgnoreCache setting for allPersistenceManagerinstances obtained from this factory.voidsetMapping(String mapping)Set the Mapping setting for this factory.voidsetMultithreaded(boolean flag)Set the default Multithreaded setting for allPersistenceManagerinstances obtained from this factory.voidsetName(String name)Sets the name of this PersistenceManagerFactory.voidsetNontransactionalRead(boolean flag)Set the default NontransactionalRead setting for allPersistenceManagerinstances obtained from this factory.voidsetNontransactionalWrite(boolean flag)Set the default NontransactionalWrite setting for allPersistenceManagerinstances obtained from this factory.voidsetOptimistic(boolean flag)Set the default Optimistic setting for allPersistenceManagerinstances obtained from this factory.voidsetPersistenceUnitName(String name)Sets the PersistenceUnitName for this PersistenceManagerFactory.voidsetReadOnly(boolean flag)Sets the value for whether the datastore is to be considered read-only.voidsetRestoreValues(boolean restoreValues)Set the default value for the RestoreValues property.voidsetRetainValues(boolean flag)Set the default RetainValues setting for allPersistenceManagerinstances obtained from this factory.voidsetServerTimeZoneID(String timezoneid)Sets the TimeZone ID of the server associated with this PersistenceManagerFactory.voidsetTransactionIsolationLevel(String level)Set the value for transaction isolation level for this PMF.voidsetTransactionType(String name)Sets the TransactionType for this PersistenceManagerFactory.Collection<String>supportedOptions()The application can determine from the results of this method which optional features, and which query languages are supported by the JDO implementation.
-
-
-
Method Detail
-
close
void close()
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.
- Since:
- 1.0.1
-
isClosed
boolean isClosed()
APersistenceManagerFactoryinstance can be used until it is closed.- Returns:
trueif thisPersistenceManagerFactoryhas been closed.- Since:
- 2.0
- See Also:
close()
-
getPersistenceManager
PersistenceManager getPersistenceManager()
Get an instance ofPersistenceManagerfrom this factory. The instance has default values for options.After the first use of
getPersistenceManager, no "set" methods will succeed.- Returns:
- a
PersistenceManagerinstance with default options.
-
getPersistenceManagerProxy
PersistenceManager getPersistenceManagerProxy()
Get a thread-safe instance of a proxy that dynamically binds on each method call to an instance ofPersistenceManager.When used with a
PersistenceManagerFactorythat uses TransactionType JTA, the proxy can be used in a server to dynamically bind to an instance from this factory associated with the thread's current transaction. In this case, the close method is ignored, as thePersistenceManageris automatically closed when the transaction completes.When used with a
PersistenceManagerFactorythat uses TransactionType RESOURCE_LOCAL, the proxy uses an inheritable ThreadLocal to bind to an instance ofPersistenceManagerassociated with the thread. In this case, the close method executed on the proxy closes thePersistenceManagerand then clears the ThreadLocal. Use of this method does not affect the configurability of thePersistenceManagerFactory.- Returns:
- a
PersistenceManagerproxy. - Since:
- 2.1
-
getPersistenceManager
PersistenceManager getPersistenceManager(String userid, String password)
Get an instance ofPersistenceManagerfrom this factory. The instance has default values for options. The parametersuseridandpasswordare used when obtaining datastore connections from the connection pool.After the first use of
getPersistenceManager, no "set" methods will succeed.- Parameters:
userid- the userid for the connectionpassword- the password for the connection- Returns:
- a
PersistenceManagerinstance with default options.
-
setConnectionUserName
void setConnectionUserName(String userName)
Set the user name for the data store connection.- Parameters:
userName- the user name for the data store connection.
-
getConnectionUserName
String getConnectionUserName()
Get the user name for the data store connection.- Returns:
- the user name for the data store connection.
-
setConnectionPassword
void setConnectionPassword(String password)
Set the password for the data store connection.- Parameters:
password- the password for the data store connection.
-
setConnectionURL
void setConnectionURL(String url)
Set the URL for the data store connection.- Parameters:
url- the URL for the data store connection.
-
getConnectionURL
String getConnectionURL()
Get the URL for the data store connection.- Returns:
- the URL for the data store connection.
-
setConnectionDriverName
void setConnectionDriverName(String driverName)
Set the driver name for the data store connection.- Parameters:
driverName- the driver name for the data store connection.
-
getConnectionDriverName
String getConnectionDriverName()
Get the driver name for the data store connection.- Returns:
- the driver name for the data store connection.
-
setConnectionFactoryName
void setConnectionFactoryName(String connectionFactoryName)
Set the name for the data store connection factory.- Parameters:
connectionFactoryName- the name of the data store connection factory.
-
getConnectionFactoryName
String getConnectionFactoryName()
Get the name for the data store connection factory.- Returns:
- the name of the data store connection factory.
-
setConnectionFactory
void setConnectionFactory(Object connectionFactory)
Set the data store connection factory. JDO implementations will support specific connection factories. The connection factory interfaces are not part of the JDO specification.- Parameters:
connectionFactory- the data store connection factory.
-
getConnectionFactory
Object getConnectionFactory()
Get the data store connection factory.- Returns:
- the data store connection factory.
-
setConnectionFactory2Name
void setConnectionFactory2Name(String connectionFactoryName)
Set the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.- Parameters:
connectionFactoryName- the name of the data store connection factory.
-
getConnectionFactory2Name
String getConnectionFactory2Name()
Get the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.- Returns:
- the name of the data store connection factory.
-
setConnectionFactory2
void setConnectionFactory2(Object connectionFactory)
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.- Parameters:
connectionFactory- the data store connection factory.
-
getConnectionFactory2
Object getConnectionFactory2()
Get the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.- Returns:
- the data store connection factory.
-
setMultithreaded
void setMultithreaded(boolean flag)
Set the default Multithreaded setting for allPersistenceManagerinstances obtained from this factory.- Parameters:
flag- the default Multithreaded setting.
-
getMultithreaded
boolean getMultithreaded()
Get the default Multithreaded setting for allPersistenceManagerinstances obtained from this factory.- Returns:
- the default Multithreaded setting.
-
setMapping
void setMapping(String mapping)
Set the Mapping setting for this factory. This is used to find the object-datastore mapping file(s).- Parameters:
mapping- the Mapping setting.
-
getMapping
String getMapping()
Get the Mapping setting for this factory. This is used to find the object-datastore mapping file(s).- Returns:
- the Mapping setting.
-
setOptimistic
void setOptimistic(boolean flag)
Set the default Optimistic setting for allPersistenceManagerinstances obtained from this factory.- Parameters:
flag- the default Optimistic setting.
-
getOptimistic
boolean getOptimistic()
Get the default Optimistic setting for allPersistenceManagerinstances obtained from this factory.- Returns:
- the default Optimistic setting.
-
setRetainValues
void setRetainValues(boolean flag)
Set the default RetainValues setting for allPersistenceManagerinstances obtained from this factory.- Parameters:
flag- the default RetainValues setting.
-
getRetainValues
boolean getRetainValues()
Get the default RetainValues setting for allPersistenceManagerinstances obtained from this factory.- Returns:
- the default RetainValues setting.
-
setRestoreValues
void setRestoreValues(boolean restoreValues)
Set the default value for the RestoreValues property. Iftrue, 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, aJDOUnsupportedOptionExceptionis thrown.- Parameters:
restoreValues- the value of the restoreValues property
-
getRestoreValues
boolean getRestoreValues()
Get the default value for the RestoreValues property.- Returns:
- the value of the restoreValues property
-
setNontransactionalRead
void setNontransactionalRead(boolean flag)
Set the default NontransactionalRead setting for allPersistenceManagerinstances obtained from this factory.- Parameters:
flag- the default NontransactionalRead setting.
-
getNontransactionalRead
boolean getNontransactionalRead()
Get the default NontransactionalRead setting for allPersistenceManagerinstances obtained from this factory.- Returns:
- the default NontransactionalRead setting.
-
setNontransactionalWrite
void setNontransactionalWrite(boolean flag)
Set the default NontransactionalWrite setting for allPersistenceManagerinstances obtained from this factory.- Parameters:
flag- the default NontransactionalWrite setting.
-
getNontransactionalWrite
boolean getNontransactionalWrite()
Get the default NontransactionalWrite setting for allPersistenceManagerinstances obtained from this factory.- Returns:
- the default NontransactionalWrite setting.
-
setIgnoreCache
void setIgnoreCache(boolean flag)
Set the default IgnoreCache setting for allPersistenceManagerinstances obtained from this factory.- Parameters:
flag- the default IgnoreCache setting.
-
getIgnoreCache
boolean getIgnoreCache()
Get the default IgnoreCache setting for allPersistenceManagerinstances obtained from this factory.- Returns:
- the default IngoreCache setting.
-
getDetachAllOnCommit
boolean getDetachAllOnCommit()
Gets the detachAllOnCommit setting.- Returns:
- the default detachAllOnCommit setting.
- Since:
- 2.0
- See Also:
setDetachAllOnCommit(boolean)
-
setDetachAllOnCommit
void setDetachAllOnCommit(boolean flag)
Sets the default detachAllOnCommit setting for allPersistenceManagerinstances obtained from this factory.- Parameters:
flag- the default DetachAllOnCommit setting- Since:
- 2.0
- See Also:
getDetachAllOnCommit()
-
getCopyOnAttach
boolean getCopyOnAttach()
Gets the default copyOnAttach setting for allPersistenceManagerinstances obtained from this factory.- Returns:
- the copyOnAttach setting.
- Since:
- 2.1
- See Also:
setCopyOnAttach(boolean)
-
setCopyOnAttach
void setCopyOnAttach(boolean flag)
Sets the default copyOnAttach setting for allPersistenceManagerinstances obtained from this factory.CopyOnAttach set to
truespecifies that during makePersistent, copies are made of detached parameter instances. With this flag set tofalse, detached parameter instances are attached directly and change their state from detached-clean to persistent-clean or from detached-dirty to persistent-dirty.- Parameters:
flag- Whether we should copy on attach- Since:
- 2.1
- See Also:
getCopyOnAttach()
-
setName
void setName(String name)
Sets the name of this PersistenceManagerFactory.- Parameters:
name- the name of this PMF- Since:
- 2.1
-
getName
String getName()
Gets the name of this PersistenceManagerFactory.- Returns:
- the name of this PMF
- Since:
- 2.1
-
setPersistenceUnitName
void setPersistenceUnitName(String name)
Sets the PersistenceUnitName for this PersistenceManagerFactory. This has the same semantics as the same-named property in JSR-220 PersistenceUnitInfo.- Parameters:
name- the PersistenceUnitName- Since:
- 2.1
- See Also:
getPersistenceUnitName()
-
getPersistenceUnitName
String getPersistenceUnitName()
Gets the PersistenceUnitName for this PersistenceManagerFactory.- Returns:
- the PersistenceUnitName
- Since:
- 2.1
- See Also:
setPersistenceUnitName(String)
-
setServerTimeZoneID
void setServerTimeZoneID(String timezoneid)
Sets the TimeZone ID of the server associated with this PersistenceManagerFactory. The parameter is a String suitable for use with TimeZone.getTimeZone(). The String must match an ID returned by TimeZone.getAvailableIDs(). If the ServerTimeZoneID is not set, or set to the null String, assume that the server has the same TimeZone ID as the client. If incorrectly set, the result of PersistenceManager.getServerDate() might be incorrect.- Parameters:
timezoneid- the TimeZone ID of the server- Throws:
JDOUserException- if the parameter does not match an ID from TimeZone.getAvailableIDs()- Since:
- 2.1
- See Also:
getServerTimeZoneID(),TimeZone.getTimeZone(String),TimeZone.getAvailableIDs(),PersistenceManager.getServerDate()
-
getServerTimeZoneID
String getServerTimeZoneID()
Gets the TimeZone ID of the server associated with this PersistenceManagerFactory. If not set, assume that the server has the same TimeZone ID as the client.- Returns:
- the TimeZone of the server
- Since:
- 2.1
- See Also:
setServerTimeZoneID(String)
-
setTransactionType
void setTransactionType(String name)
Sets the TransactionType for this PersistenceManagerFactory. Permitted values are "JTA" and "RESOURCE_LOCAL". This has the same semantics as the same-named property in JSR-220 EntityManagerFactory.- Parameters:
name- the TransactionType- Throws:
JDOUserException- if the parameter is not a permitted value- Since:
- 2.1
- See Also:
getTransactionType(),Constants.JTA,Constants.RESOURCE_LOCAL
-
getTransactionType
String getTransactionType()
Gets the TransactionType for this PersistenceManagerFactory.- Returns:
- the TransactionType
- Since:
- 2.1
- See Also:
setTransactionType(String)
-
getReadOnly
boolean getReadOnly()
Gets the value for read-only for this PMF. Indicates whether the datastore is read-only or writable.- Returns:
- the readOnly setting.
- Since:
- 2.2
- See Also:
setReadOnly(boolean)
-
setReadOnly
void setReadOnly(boolean flag)
Sets the value for whether the datastore is to be considered read-only.ReadOnly set to
falsespecifies that no updates can be performed to the datastore, and if updates are attempted a JDOReadOnlyException is thrown.- Parameters:
flag- whether we should consider this datastore read-only- Since:
- 2.2
- See Also:
getReadOnly()
-
getTransactionIsolationLevel
String getTransactionIsolationLevel()
Get the value for transaction isolation level for this PMF.- Returns:
- the transaction isolation level
- Since:
- 2.2
- See Also:
setTransactionIsolationLevel(String)
-
setTransactionIsolationLevel
void setTransactionIsolationLevel(String level)
Set the value for transaction isolation level for this PMF. Transaction isolation levels are defined in javax.jdo.Constants. If the requested level is not available, but a higher level is available, the higher level is silently used. If the requested level is not available, and no higher level is available, then JDOUnsupportedOptionException is thrown. Standard values in order from low to high are:- read-uncommitted
- read-committed
- repeatable-read
- snapshot
- serializable
- Parameters:
level- the transaction isolation level- Since:
- 2.2
- See Also:
getTransactionIsolationLevel(),Constants.TX_READ_UNCOMMITTED,Constants.TX_READ_COMMITTED,Constants.TX_REPEATABLE_READ,Constants.TX_SNAPSHOT,Constants.TX_SERIALIZABLE
-
setDatastoreReadTimeoutMillis
void setDatastoreReadTimeoutMillis(Integer interval)
Specify a default timeout interval (milliseconds) for any read operations for persistence managers obtained from this persistence manager factory. To unset the explicit timeout, specify null. For no timeout, specify 0. If the datastore and JDO implementation support timeouts, then javax.jdo.option.DatastoreTimeout is returned by supportedOptions(). If timeouts are not supported,this method will throw JDOUnsupportedOptionException.- Parameters:
interval- the timeout interval (milliseconds)- Since:
- 3.0
-
getDatastoreReadTimeoutMillis
Integer getDatastoreReadTimeoutMillis()
Get the default timeout setting for read operations. If timeouts are not supported,this method will return null.- Returns:
- the default timeout setting (milliseconds).
- Since:
- 3.0
- See Also:
setDatastoreReadTimeoutMillis(Integer)
-
setDatastoreWriteTimeoutMillis
void setDatastoreWriteTimeoutMillis(Integer interval)
Specify a default timeout interval (milliseconds) for any write operations for persistence managers obtained from this persistence manager factory. To unset the explicit timeout, specify null. For no timeout, specify 0. If the datastore and JDO implementation support timeouts, then javax.jdo.option.DatastoreTimeout is returned by supportedOptions(). If timeouts are not supported,this method will throw JDOUnsupportedOptionException.- Parameters:
interval- the timeout interval (milliseconds)- Since:
- 3.0
-
getDatastoreWriteTimeoutMillis
Integer getDatastoreWriteTimeoutMillis()
Get the default timeout setting for write operations. If timeouts are not supported,this method will return null.- Returns:
- the default timeout setting (milliseconds).
- Since:
- 3.0
- See Also:
setDatastoreWriteTimeoutMillis(Integer)
-
getProperties
Properties getProperties()
Return non-configurable properties of thisPersistenceManagerFactory. Properties with keysVendorNameandVersionNumberare required. Other keys are optional.- Returns:
- the non-configurable properties of this
PersistenceManagerFactory.
-
supportedOptions
Collection<String> supportedOptions()
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 feature is represented by a
Stringwith 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.NonDurableIdentity
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
javax.jdo.option.ChangeApplicationIdentity
javax.jdo.option.BinaryCompatibility
javax.jdo.option.GetDataStoreConnection
javax.jdo.option.UnconstrainedQueryVariables
javax.jdo.option.TransactionIsolationLevel.read-uncommitted
javax.jdo.option.TransactionIsolationLevel.read-committed
javax.jdo.option.TransactionIsolationLevel.repeatable-read
javax.jdo.option.TransactionIsolationLevel.snapshot
javax.jdo.option.TransactionIsolationLevel.serializable
javax.jdo.option.QueryCancel
javax.jdo.option.DatastoreTimeout
javax.jdo.query.SQL
javax.jdo.query.JDOQLThe standard JDO query language is represented by a
String:javax.jdo.query.JDOQL- Returns:
- the
CollectionofStrings representing the supported options.
-
getDataStoreCache
DataStoreCache getDataStoreCache()
Return theDataStoreCachethat this factory uses for controlling a second-level cache. If this factory does not use a second-level cache, the returned instance does nothing. This method never returnsnull.- Returns:
- the DataStoreCache
- Since:
- 2.0
-
addInstanceLifecycleListener
void addInstanceLifecycleListener(InstanceLifecycleListener listener, Class[] classes)
Add the parameter listener to the list of instance lifecycle event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory. TheaddInstanceLifecycleListenerandremoveInstanceLifecycleListenermethods are considered to be configuration methods and can only be called when the PersistenceManagerFactory is configurable (before the first timegetPersistenceManager()is called).The
classesparameter identifies all of the classes of interest. If theclassesparameter is specified asnull, events for all persistent classes and interfaces will be sent to the listener.The listener will be called for each event for which it implements the corresponding
InstanceLifecycleListenerinterface.- Parameters:
listener- the lifecycle listenerclasses- the classes of interest to the listener- Since:
- 2.0
-
removeInstanceLifecycleListener
void removeInstanceLifecycleListener(InstanceLifecycleListener listener)
Remove the parameter listener instance from the list of instance lifecycle event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory. TheaddInstanceLifecycleListenerandremoveInstanceLifecycleListenermethods are considered to be configuration methods and can only be called when the PersistenceManagerFactory is configurable (before the first timegetPersistenceManager()is called).- Parameters:
listener- the listener instance to be removed- Since:
- 2.0
-
addFetchGroups
void addFetchGroups(FetchGroup... groups)
Add theFetchGroups to the set of active fetch groups.FetchGroups are made unmodifiable before being added.FetchGroups that match existingFetchGroups replace the correspondingFetchGroups. The replacedFetchGroups become unscoped. Match is based on identical class and equal name. The methodsaddFetchGroups(javax.jdo.FetchGroup...),removeFetchGroups(javax.jdo.FetchGroup...),getFetchGroups(), andremoveAllFetchGroups()are internally serialized.- Parameters:
groups- an array of FetchGroups- Throws:
SecurityException- if the caller is not authorized forJDOPermission("manageMetadata")- Since:
- 2.2
-
removeFetchGroups
void removeFetchGroups(FetchGroup... groups)
Remove theFetchGroups from the set of activeFetchGroups. ExistingFetchGroups that match parameterFetchGroups are removed. ParameterFetchGroups that do not match any existingFetchGroupare ignored. RemovedFetchGroups become unscoped. Match is based on identical class and equal name. The methodsaddFetchGroups(javax.jdo.FetchGroup...),removeFetchGroups(javax.jdo.FetchGroup...),getFetchGroups(), andremoveAllFetchGroups()are internally serialized.- Parameters:
groups- an array of FetchGroups- Throws:
SecurityException- if the caller is not authorized forJDOPermission("manageMetadata")- Since:
- 2.2
-
removeAllFetchGroups
void removeAllFetchGroups()
Remove allFetchGroups from the set of activeFetchGroups. All removedFetchGroups become unscoped. The methodsaddFetchGroups(javax.jdo.FetchGroup...),removeFetchGroups(javax.jdo.FetchGroup...),getFetchGroups(), andremoveAllFetchGroups()are internally serialized.- Throws:
SecurityException- if the caller is not authorized forJDOPermission("manageMetadata")- Since:
- 2.2
-
getFetchGroup
FetchGroup getFetchGroup(Class cls, String name)
Create an unscoped, modifiableFetchGroupfor the Class and name. If a correspondingFetchGroupalready exists inPersistenceManagerFactoryscope, copy its definition to a newFetchGroup. If theFetchGroupdoes not already exist, create it with no members. TheFetchGroupdoes not become in scope until it is added to the current set viaaddFetchGroups(javax.jdo.FetchGroup...).- Parameters:
cls- the class or interface for the FetchGroupname- the name of the fetch group- Returns:
- the FetchGroup
- Throws:
JDOUserException- if the class is not a persistence-capable class or interface- Since:
- 2.2
-
getFetchGroups
Set getFetchGroups()
Get a modifiable Set containing a mutable copy of all currently active (in scope) fetch groups. The methodsaddFetchGroups(javax.jdo.FetchGroup...),removeFetchGroups(javax.jdo.FetchGroup...),getFetchGroups(), andremoveAllFetchGroups()are internally serialized.- Returns:
- a copy of all currently active fetch groups
- Throws:
SecurityException- if the caller is not authorized forJDOPermission("getMetadata")- Since:
- 2.2
-
registerMetadata
void registerMetadata(JDOMetadata metadata)
Method to register metadata with the persistence process managed by thisPersistenceManagerFactory. Metadata can be created using the methodnewMetadata(). If there is already metadata registered for a class contained in this metadata object then a JDOUserException will be thrown.- Parameters:
metadata- The Metadata to register.- Since:
- 3.0
-
newMetadata
JDOMetadata newMetadata()
Method to return a new metadata object that can be subsequently modified and registered with the persistence process using the methodregisterMetadata(javax.jdo.metadata.JDOMetadata).- Returns:
- The metadata
- Since:
- 3.0
-
getMetadata
TypeMetadata getMetadata(String className)
Method to return the metadata object for the specified class/interface, if there is metadata defined for that class/interface. If there is no metadata for the specified class/interface, or the parameter is null, then null will be returned.- Parameters:
className- Name of the class to get metadata for- Returns:
- The metadata
- Since:
- 3.0
-
getManagedClasses
Collection<Class> getManagedClasses()
Method to return the currently managed classes for this factory.- Returns:
- Collection of persistable classes that are managed by this factory
- Since:
- 3.1
-
-