|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.persistence.EntityManagerImpl
public class EntityManagerImpl
Implementation of EntityManager interface.
| Field Summary |
|---|
| Fields inherited from interface org.apache.openjpa.kernel.ConnectionRetainModes |
|---|
CONN_RETAIN_ALWAYS, CONN_RETAIN_DEMAND, CONN_RETAIN_TRANS |
| Fields inherited from interface org.apache.openjpa.kernel.DetachState |
|---|
DETACH_ALL, DETACH_FGS, DETACH_LOADED |
| Fields inherited from interface org.apache.openjpa.kernel.RestoreState |
|---|
RESTORE_ALL, RESTORE_IMMUTABLE, RESTORE_NONE |
| Fields inherited from interface org.apache.openjpa.kernel.AutoDetach |
|---|
DETACH_CLOSE, DETACH_COMMIT, DETACH_NONTXREAD |
| Fields inherited from interface org.apache.openjpa.kernel.AutoClear |
|---|
CLEAR_ALL, CLEAR_DATASTORE |
| Fields inherited from interface org.apache.openjpa.event.CallbackModes |
|---|
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK |
| Fields inherited from interface org.apache.openjpa.kernel.OpCallbacks |
|---|
ACT_CASCADE, ACT_NONE, ACT_RUN, OP_ATTACH, OP_DELETE, OP_DETACH, OP_EVICT, OP_LOCK, OP_NONTRANSACTIONAL, OP_PERSIST, OP_REFRESH, OP_RELEASE, OP_RETRIEVE, OP_TRANSACTIONAL |
| Constructor Summary | |
|---|---|
EntityManagerImpl(EntityManagerFactoryImpl factory,
Broker broker)
Constructor; supply factory and delegate. |
|
| Method Summary | ||
|---|---|---|
void |
addLifecycleListener(Object listener,
Class... classes)
Register a listener for lifecycle-related events on the specified classes. |
|
void |
addTransactionListener(Object listener)
Register a listener for transaction-related events. |
|
void |
begin()
|
|
void |
beginStore()
Begins a store transaction if one isn't already started. |
|
boolean |
cancelAll()
Cancel all pending data store statements. |
|
void |
clear()
|
|
void |
close()
|
|
void |
commit()
|
|
void |
commitAndResume()
Issue a commit and then start a new transaction. |
|
boolean |
contains(Object entity)
|
|
boolean |
containsAll(Collection entities)
Whether the given objects are managed. |
|
boolean |
containsAll(Object... entities)
Whether the given objects are managed. |
|
|
createExtent(Class<T> cls,
boolean subclasses)
Return an extent of the given class, optionally including subclasses. |
|
|
createInstance(Class<T> cls)
Create a new instance of type cls. |
|
Interaction |
createInteraction()
|
|
OpenJPAQuery |
createNamedQuery(String name)
|
|
OpenJPAQuery |
createNativeQuery(String query)
|
|
OpenJPAQuery |
createNativeQuery(String query,
Class cls)
|
|
OpenJPAQuery |
createNativeQuery(String query,
String mappingName)
|
|
OpenJPAQuery |
createQuery(String query)
|
|
OpenJPAQuery |
createQuery(String language,
String query)
Create a new query in the given language. |
|
|
detach(T entity)
Detach the specified object from the entity manager. |
|
Collection |
detachAll(Collection entities)
Detach the specified objects from the entity manager. |
|
Object[] |
detachAll(Object... entities)
Detach the specified objects from the entity manager. |
|
void |
dirty(Object o,
String field)
Make the named field of the given object dirty. |
|
void |
dirtyClass(Class cls)
Mark the given class as dirty within the current transaction. |
|
boolean |
equals(Object other)
|
|
void |
evict(Object entity)
Evict the given object. |
|
void |
evictAll()
Evict all clean objects. |
|
void |
evictAll(Class cls)
Evict all persistent-clean and persistent-nontransactional instances in the extent of the given class (including subclasses). |
|
void |
evictAll(Collection entities)
Evict the given objects. |
|
void |
evictAll(Extent extent)
Evict all persistent-clean and persistent-nontransactional instances in the given Extent. |
|
void |
evictAll(Object... entities)
Evict the given objects. |
|
|
find(Class<T> cls,
Object oid)
|
|
|
findAll(Class<T> cls,
Collection oids)
Return the objects with the given oids. |
|
|
findAll(Class<T> cls,
Object... oids)
Return the objects with the given oids. |
|
|
findCached(Class<T> cls,
Object oid)
Return the cached instance for the given oid/object, or null if not cached. |
|
void |
flush()
|
|
int |
getAutoClear()
Whether to clear state when entering a transaction. |
|
int |
getAutoDetach()
Bit flags marked in AutoDetach which indicate when persistent
managed objects should be automatically detached in-place. |
|
Broker |
getBroker()
Broker delegate. |
|
ClassLoader |
getClassLoader()
Return the current thread's class loader at the time this entity manager was obtained from the factory. |
|
OpenJPAConfiguration |
getConfiguration()
Return the configuration associated with this entity manager. |
|
Object |
getConnection()
Return the connection in use by the entity manager, or a new connection if none. |
|
String |
getConnectionPassword()
Return the connection password. |
|
int |
getConnectionRetainMode()
Return the connection retain mode for this entity manager. |
|
String |
getConnectionUserName()
Return the connection user name. |
|
Object |
getDelegate()
|
|
int |
getDetachState()
Detach mode constant to determine which fields are part of the detached graph. |
|
Collection |
getDirtyObjects()
Return a set of current dirty instances. |
|
OpenJPAEntityManagerFactory |
getEntityManagerFactory()
Return the factory that produced this entity manager. |
|
boolean |
getEvictFromStoreCache()
Whether to also evict an object from the store cache when it is evicted through this entity manager. |
|
FetchPlan |
getFetchPlan()
Return the (mutable) fetch plan for loading objects from this entity manager. |
|
Generator |
getFieldGenerator(Class forClass,
String fieldName)
Returns a Generator for the generated values of the specified
type, or null if the field is not generated. |
|
FlushModeType |
getFlushMode()
|
|
Generator |
getIdGenerator(Class forClass)
Returns a Generator for the datastore identity values of the
specified type, or null if the type is unmanaged or its identity
cannot be represented by a sequence. |
|
boolean |
getIgnoreChanges()
Whether to take into account changes in the transaction when executing a query or iterating an extent. |
|
int |
getLifecycleListenerCallbackMode()
The CallbackModes flags for handling lifecycle listener
exceptions. |
|
LocalTransaction |
getLocalTransaction()
|
|
LockModeType |
getLockMode(Object entity)
Return the lock mode of the given instance, or null if not locked. |
|
Collection |
getManagedObjects()
Return a set of all managed instances. |
|
ManagedRuntime |
getManagedRuntime()
Return the managed runtime in use. |
|
ConnectionMetaData |
getMetaData()
|
|
boolean |
getMultithreaded()
Whether the entity manager or its managed instances are used in a multithreaded environment. |
|
Generator |
getNamedGenerator(String name)
Return the named generator defined in the metadata. |
|
boolean |
getNontransactionalRead()
Whether to allow nontransactional access to persistent state. |
|
boolean |
getNontransactionalWrite()
Whether to allow nontransactional changes to persistent state. |
|
Object |
getObjectId(Object o)
Return the oid of the given instance. |
|
Class |
getObjectIdClass(Class cls)
Return the application identity class the given persistent class uses for object ids, or null if not a type that uses application identity. |
|
boolean |
getOptimistic()
Whether to use optimistic transactional semantics. |
|
boolean |
getOrderDirtyObjects()
Whether dirty objects will be returned in the order they were dirtied. |
|
Collection |
getPendingTransactionalObjects()
Return a set of instances which will become transactional upon the next transaction. |
|
Collection<Class> |
getPersistedClasses()
Return the set of classes that have been made persistent in the current transaction. |
|
boolean |
getPopulateStoreCache()
Whether objects accessed during this transaction will be added to the store cache. |
|
|
getReference(Class<T> cls,
Object oid)
|
|
Collection<Class> |
getRemovedClasses()
Return the set of classes that have been deleted in the current transaction. |
|
int |
getRestoreState()
Whether to restore an object's original state on rollback. |
|
ResultSetInfo |
getResultSetInfo()
|
|
boolean |
getRetainState()
Whether objects retain their persistent state on transaction commit. |
|
boolean |
getRollbackOnly()
Return whether the current transaction has been marked for rollback. |
|
boolean |
getSyncWithManagedTransactions()
Whether to check for a global transaction upon every managed, non-transactional operation. |
|
EntityTransaction |
getTransaction()
|
|
Collection |
getTransactionalObjects()
Return a set of current transaction instances. |
|
int |
getTransactionListenerCallbackMode()
The CallbackModes flags for handling transaction listener
exceptions. |
|
Collection<Class> |
getUpdatedClasses()
Return the set of classes for objects that have been modified in the current transaction. |
|
Object |
getUserObject(Object key)
Get the value for the specified key from the map of user objects. |
|
Object |
getVersion(Object o)
Returns the current version indicator for o. |
|
int |
hashCode()
|
|
boolean |
isActive()
|
|
boolean |
isDetached(Object entity)
Returns true if pc is a detached object
(one that can be reattached to a EntityManager via a call
to EntityManager#merge); otherwise returns
false. |
|
boolean |
isDirty(Object o)
Return whether the given object is dirty. |
|
boolean |
isLargeTransaction()
Whether memory usage is reduced during this transaction at the expense of possibly more aggressive data cache evictions. |
|
boolean |
isManaged()
Whether this entity manager is using managed transactions. |
|
boolean |
isNewlyPersistent(Object o)
Return whether the given object was made persistent in the current transaction. |
|
boolean |
isOpen()
|
|
boolean |
isPersistent(Object o)
Return whether the given object is persistent. |
|
boolean |
isRemoved(Object o)
Return whether the given object is deleted. |
|
boolean |
isStoreActive()
Whether a store transaction is active. |
|
boolean |
isTransactional(Object o)
Return whether the given object is transactional. |
|
void |
joinTransaction()
|
|
void |
lock(Object entity)
Ensure that the given instance is locked at the current lock level, as set in the FetchPlan for the entity manager. |
|
void |
lock(Object entity,
LockModeType mode)
|
|
void |
lock(Object entity,
LockModeType mode,
int timeout)
Ensure that the given instance is locked at the given lock level. |
|
void |
lockAll(Collection entities)
Ensure that the given instances are locked at the current lock level, as set in the FetchPlan for the entity manager. |
|
void |
lockAll(Collection entities,
LockModeType mode,
int timeout)
Ensure that the given instances are locked at the given lock level. |
|
void |
lockAll(Object... entities)
Ensure that the given instances are locked at the current lock level, as set in the FetchPlan for the entity manager. |
|
void |
lockAll(Object[] entities,
LockModeType mode,
int timeout)
Ensure that the given instances are locked at the given lock level. |
|
|
merge(T entity)
|
|
Collection |
mergeAll(Collection entities)
Merge the specified detached objects into the entity manager. |
|
Object[] |
mergeAll(Object... entities)
Merge the specified objects into the entity manager. |
|
void |
nontransactional(Object entity)
Make the given object nontransactional. |
|
void |
nontransactionalAll(Collection objs)
Make the given objects nontransactional. |
|
void |
nontransactionalAll(Object[] objs)
Make the given objects nontransactional. |
|
void |
persist(Object entity)
|
|
void |
persistAll(Collection entities)
Persist the given objects. |
|
void |
persistAll(Object... entities)
Persist the given objects. |
|
void |
preFlush()
Run pre-flush actions on transactional objects, including persistence-by-reachability, inverse relationship management, deletion of dependent instances, and instance callbacks. |
|
int |
processArgument(int op,
Object obj,
OpenJPAStateManager sm)
Process operation argument. |
|
Object |
processArgument(Object arg)
Process find argument. |
|
Object |
processReturn(Object oid,
OpenJPAStateManager sm)
Process operation return value. |
|
Object |
putUserObject(Object key,
Object val)
Put the specified key-value pair into the map of user objects. |
|
void |
refresh(Object entity)
|
|
void |
refreshAll()
Refresh all transactional objects. |
|
void |
refreshAll(Collection entities)
Refresh the state of the given objects. |
|
void |
refreshAll(Object... entities)
Refresh the state of the given objects. |
|
void |
release(Object entity)
Release the given object from management. |
|
void |
releaseAll(Collection entities)
Release the given objects from management. |
|
void |
releaseAll(Object... entities)
Release the given object from management. |
|
void |
releaseSavepoint()
Release the last set savepoint and any resources associated with it. |
|
void |
releaseSavepoint(String name)
Release the savepoint and any resources associated with it. |
|
void |
remove(Object entity)
|
|
void |
removeAll(Collection entities)
Delete the given persistent objects. |
|
void |
removeAll(Object... entities)
Delete the given persistent objects. |
|
void |
removeLifecycleListener(Object listener)
Remove a listener for lifecycle-related events. |
|
void |
removeTransactionListener(Object listener)
Remove a listener for transaction-related events. |
|
void |
retrieve(Object entity)
Immediately load the given object's persistent fields. |
|
void |
retrieveAll(Collection entities)
Retrieve the persistent state of the given objects. |
|
void |
retrieveAll(Object... entities)
Retrieve the persistent state of the given objects. |
|
void |
rollback()
|
|
void |
rollbackAndResume()
Issue a rollback and then start a new transaction. |
|
void |
rollbackToSavepoint()
Rollback the current transaction to the last savepoint. |
|
void |
rollbackToSavepoint(String name)
Rollback the current transaction to the given savepoint name. |
|
void |
setAutoClear(int val)
Whether to clear state when entering a transaction. |
|
void |
setAutoDetach(int flags)
Bit flags marked in AutoDetach which indicate when persistent
managed objects should be automatically detached in-place. |
|
void |
setAutoDetach(int flag,
boolean on)
Bit flags marked in AutoDetach which indicate when persistent
managed objects should be automatically detached in-place. |
|
void |
setDetachState(int mode)
Detach mode constant to determine which fields are part of the detached graph. |
|
void |
setEvictFromStoreCache(boolean evict)
Whether to also evict an object from the store cache when it is evicted through this entity manager. |
|
void |
setFlushMode(FlushModeType flushMode)
|
|
void |
setIgnoreChanges(boolean val)
Whether to take into account changes in the transaction when executing a query or iterating an extent. |
|
void |
setLargeTransaction(boolean largeTransaction)
If a large number of objects will be created, modified, or deleted during this transaction setting this option to true will reduce memory usage if you perform periodic flushes. |
|
void |
setLifecycleListenerCallbackMode(int mode)
The CallbackModes flags for handling lifecycle listener
exceptions. |
|
void |
setMultithreaded(boolean multithreaded)
Whether the entity manager or its managed instances are used in a multithreaded environment. |
|
void |
setNontransactionalRead(boolean val)
Whether to allow nontransactional access to persistent state. |
|
void |
setNontransactionalWrite(boolean val)
Whether to allow nontransactional changes to persistent state. |
|
void |
setOptimistic(boolean val)
Whether to use optimistic transactional semantics. |
|
void |
setOrderDirtyObjects(boolean order)
Whether dirty objects will be returned in the order they were dirtied. |
|
void |
setPopulateStoreCache(boolean cache)
Whether to populate the store cache with objects used by this transaction. |
|
void |
setRestoreState(int val)
Whether to restore an object's original state on rollback. |
|
void |
setRetainState(boolean val)
Whether objects retain their persistent state on transaction commit. |
|
void |
setRollbackOnly()
Mark the current transaction for rollback. |
|
void |
setSavepoint(String name)
Set a transactional savepoint where operations after this savepoint will be rolled back. |
|
void |
setSyncWithManagedTransactions(boolean sync)
Whether to check for a global transaction upon every managed, non-transactional operation. |
|
void |
setTransactionListenerCallbackMode(int mode)
The CallbackModes flags for handling transaction listener
exceptions. |
|
void |
transactional(Object entity,
boolean updateVersion)
Make the given object transactional. |
|
void |
transactionalAll(Collection objs,
boolean updateVersion)
Make the given objects transactional. |
|
void |
transactionalAll(Object[] objs,
boolean updateVersion)
Make the given objects transactional. |
|
void |
validateChanges()
Validate the changes made in this transaction, reporting any optimistic violations, constraint violations, etc. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EntityManagerImpl(EntityManagerFactoryImpl factory,
Broker broker)
| Method Detail |
|---|
public Broker getBroker()
public ConnectionMetaData getMetaData()
throws ResourceException
ResourceException
public Interaction createInteraction()
throws ResourceException
ResourceException
public LocalTransaction getLocalTransaction()
throws ResourceException
ResourceException
public ResultSetInfo getResultSetInfo()
throws ResourceException
ResourceExceptionpublic OpenJPAEntityManagerFactory getEntityManagerFactory()
OpenJPAEntityManager
getEntityManagerFactory in interface OpenJPAEntityManagerpublic OpenJPAConfiguration getConfiguration()
OpenJPAEntityManager
getConfiguration in interface OpenJPAEntityManagerpublic FetchPlan getFetchPlan()
OpenJPAEntityManager
getFetchPlan in interface OpenJPAEntityManagerpublic int getConnectionRetainMode()
OpenJPAEntityManager
getConnectionRetainMode in interface OpenJPAEntityManagerConnectionRetainModespublic boolean isManaged()
OpenJPAEntityManager
isManaged in interface OpenJPAEntityManagerpublic ManagedRuntime getManagedRuntime()
OpenJPAEntityManager
getManagedRuntime in interface OpenJPAEntityManagerpublic boolean getSyncWithManagedTransactions()
OpenJPAEntityManager
getSyncWithManagedTransactions in interface OpenJPAEntityManagerpublic void setSyncWithManagedTransactions(boolean sync)
OpenJPAEntityManager
setSyncWithManagedTransactions in interface OpenJPAEntityManagerpublic ClassLoader getClassLoader()
OpenJPAEntityManager
getClassLoader in interface OpenJPAEntityManagerpublic String getConnectionUserName()
OpenJPAEntityManager
getConnectionUserName in interface OpenJPAEntityManagerpublic String getConnectionPassword()
OpenJPAEntityManager
getConnectionPassword in interface OpenJPAEntityManagerpublic boolean getMultithreaded()
OpenJPAEntityManager
getMultithreaded in interface OpenJPAEntityManagerpublic void setMultithreaded(boolean multithreaded)
OpenJPAEntityManager
setMultithreaded in interface OpenJPAEntityManagerpublic boolean getIgnoreChanges()
OpenJPAEntityManager
getIgnoreChanges in interface OpenJPAEntityManagerpublic void setIgnoreChanges(boolean val)
OpenJPAEntityManager
setIgnoreChanges in interface OpenJPAEntityManagerpublic boolean getNontransactionalRead()
OpenJPAEntityManager
getNontransactionalRead in interface OpenJPAEntityManagerpublic void setNontransactionalRead(boolean val)
OpenJPAEntityManager
setNontransactionalRead in interface OpenJPAEntityManagerpublic boolean getNontransactionalWrite()
OpenJPAEntityManager
getNontransactionalWrite in interface OpenJPAEntityManagerpublic void setNontransactionalWrite(boolean val)
OpenJPAEntityManager
setNontransactionalWrite in interface OpenJPAEntityManagerpublic boolean getOptimistic()
OpenJPAEntityManager
getOptimistic in interface OpenJPAEntityManagerpublic void setOptimistic(boolean val)
OpenJPAEntityManager
setOptimistic in interface OpenJPAEntityManagerpublic int getRestoreState()
OpenJPAEntityManager
getRestoreState in interface OpenJPAEntityManagerRestoreStatepublic void setRestoreState(int val)
OpenJPAEntityManager
setRestoreState in interface OpenJPAEntityManagerRestoreStatepublic boolean getRetainState()
OpenJPAEntityManager
getRetainState in interface OpenJPAEntityManagerpublic void setRetainState(boolean val)
OpenJPAEntityManager
setRetainState in interface OpenJPAEntityManagerpublic int getAutoClear()
OpenJPAEntityManager
getAutoClear in interface OpenJPAEntityManagerAutoClearpublic void setAutoClear(int val)
OpenJPAEntityManager
setAutoClear in interface OpenJPAEntityManagerAutoClearpublic int getDetachState()
OpenJPAEntityManager
getDetachState in interface OpenJPAEntityManagerDetachStatepublic void setDetachState(int mode)
OpenJPAEntityManager
setDetachState in interface OpenJPAEntityManagerDetachStatepublic int getAutoDetach()
OpenJPAEntityManagerAutoDetach which indicate when persistent
managed objects should be automatically detached in-place.
getAutoDetach in interface OpenJPAEntityManagerpublic void setAutoDetach(int flags)
OpenJPAEntityManagerAutoDetach which indicate when persistent
managed objects should be automatically detached in-place.
setAutoDetach in interface OpenJPAEntityManager
public void setAutoDetach(int flag,
boolean on)
OpenJPAEntityManagerAutoDetach which indicate when persistent
managed objects should be automatically detached in-place.
setAutoDetach in interface OpenJPAEntityManagerpublic boolean getEvictFromStoreCache()
OpenJPAEntityManager
getEvictFromStoreCache in interface OpenJPAEntityManagerpublic void setEvictFromStoreCache(boolean evict)
OpenJPAEntityManager
setEvictFromStoreCache in interface OpenJPAEntityManagerpublic boolean getPopulateStoreCache()
OpenJPAEntityManager
getPopulateStoreCache in interface OpenJPAEntityManagerpublic void setPopulateStoreCache(boolean cache)
OpenJPAEntityManager
setPopulateStoreCache in interface OpenJPAEntityManagerpublic boolean isLargeTransaction()
OpenJPAEntityManager
isLargeTransaction in interface OpenJPAEntityManagerpublic void setLargeTransaction(boolean largeTransaction)
OpenJPAEntityManager
setLargeTransaction in interface OpenJPAEntityManagerpublic Object getUserObject(Object key)
OpenJPAEntityManager
getUserObject in interface OpenJPAEntityManager
public Object putUserObject(Object key,
Object val)
OpenJPAEntityManager
putUserObject in interface OpenJPAEntityManagerpublic void addTransactionListener(Object listener)
OpenJPAEntityManager
addTransactionListener in interface OpenJPAEntityManagerpublic void removeTransactionListener(Object listener)
OpenJPAEntityManager
removeTransactionListener in interface OpenJPAEntityManagerpublic int getTransactionListenerCallbackMode()
OpenJPAEntityManagerCallbackModes flags for handling transaction listener
exceptions.
getTransactionListenerCallbackMode in interface OpenJPAEntityManagerpublic void setTransactionListenerCallbackMode(int mode)
OpenJPAEntityManagerCallbackModes flags for handling transaction listener
exceptions.
setTransactionListenerCallbackMode in interface OpenJPAEntityManager
public void addLifecycleListener(Object listener,
Class... classes)
OpenJPAEntityManager
addLifecycleListener in interface OpenJPAEntityManagerpublic void removeLifecycleListener(Object listener)
OpenJPAEntityManager
removeLifecycleListener in interface OpenJPAEntityManagerpublic int getLifecycleListenerCallbackMode()
OpenJPAEntityManagerCallbackModes flags for handling lifecycle listener
exceptions.
getLifecycleListenerCallbackMode in interface OpenJPAEntityManagerpublic void setLifecycleListenerCallbackMode(int mode)
OpenJPAEntityManagerCallbackModes flags for handling lifecycle listener
exceptions.
setLifecycleListenerCallbackMode in interface OpenJPAEntityManager
public <T> T getReference(Class<T> cls,
Object oid)
public <T> T find(Class<T> cls,
Object oid)
public <T> T[] findAll(Class<T> cls,
Object... oids)
OpenJPAEntityManager
findAll in interface OpenJPAEntityManageroids - the oids of the objects to return
#find(Class,Object)
public <T> Collection<T> findAll(Class<T> cls,
Collection oids)
OpenJPAEntityManager
findAll in interface OpenJPAEntityManageroids - the oids of the objects to return
#find(Class,Object)
public <T> T findCached(Class<T> cls,
Object oid)
OpenJPAEntityManager
findCached in interface OpenJPAEntityManageroid - the object's id
public Class getObjectIdClass(Class cls)
OpenJPAEntityManager
getObjectIdClass in interface OpenJPAEntityManagerpublic EntityTransaction getTransaction()
public void joinTransaction()
public void begin()
public void commit()
public void rollback()
public void commitAndResume()
OpenJPAEntityManagermanager.commit (); manager.begin ();except that the entity manager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
commitAndResume in interface OpenJPAEntityManager#commit(),
#begin()public void rollbackAndResume()
OpenJPAEntityManagermanager.rollback (); manager.begin ();except that the entity manager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
rollbackAndResume in interface OpenJPAEntityManager#rollback(),
#begin()public boolean getRollbackOnly()
OpenJPAEntityManager
getRollbackOnly in interface OpenJPAEntityManagerpublic void setRollbackOnly()
OpenJPAEntityManager
setRollbackOnly in interface OpenJPAEntityManagerpublic void setSavepoint(String name)
OpenJPAEntityManager
setSavepoint in interface OpenJPAEntityManagerpublic void rollbackToSavepoint()
OpenJPAEntityManager
rollbackToSavepoint in interface OpenJPAEntityManagerpublic void rollbackToSavepoint(String name)
OpenJPAEntityManager
rollbackToSavepoint in interface OpenJPAEntityManagerpublic void releaseSavepoint()
OpenJPAEntityManager
releaseSavepoint in interface OpenJPAEntityManagerpublic void releaseSavepoint(String name)
OpenJPAEntityManager
releaseSavepoint in interface OpenJPAEntityManagerpublic void flush()
public void preFlush()
OpenJPAEntityManager
preFlush in interface OpenJPAEntityManagerpublic void validateChanges()
OpenJPAEntityManager#flush(). In an optimistic transaction that has not yet begun a
datastore-level transaction, however, it will only report exceptions
that would occur on flush, without retaining any datastore resources.
validateChanges in interface OpenJPAEntityManagerpublic boolean isActive()
public boolean isStoreActive()
OpenJPAEntityManager
isStoreActive in interface OpenJPAEntityManagerpublic void beginStore()
OpenJPAEntityManager
beginStore in interface OpenJPAEntityManagerpublic boolean contains(Object entity)
public boolean containsAll(Object... entities)
OpenJPAEntityManager
containsAll in interface OpenJPAEntityManagerpublic boolean containsAll(Collection entities)
OpenJPAEntityManager
containsAll in interface OpenJPAEntityManagerpublic void persist(Object entity)
public void persistAll(Object... entities)
OpenJPAEntityManager
persistAll in interface OpenJPAEntityManagerpublic void persistAll(Collection entities)
OpenJPAEntityManager
persistAll in interface OpenJPAEntityManagerpublic void remove(Object entity)
public void removeAll(Object... entities)
OpenJPAEntityManager
removeAll in interface OpenJPAEntityManagerpublic void removeAll(Collection entities)
OpenJPAEntityManager
removeAll in interface OpenJPAEntityManagerpublic void release(Object entity)
OpenJPAEntityManager
release in interface OpenJPAEntityManagerpublic void releaseAll(Collection entities)
OpenJPAEntityManager
releaseAll in interface OpenJPAEntityManagerpublic void releaseAll(Object... entities)
OpenJPAEntityManager
releaseAll in interface OpenJPAEntityManagerpublic void refresh(Object entity)
public void refreshAll()
OpenJPAEntityManager
refreshAll in interface OpenJPAEntityManagerpublic void refreshAll(Collection entities)
OpenJPAEntityManager
refreshAll in interface OpenJPAEntityManagerpublic void refreshAll(Object... entities)
OpenJPAEntityManager
refreshAll in interface OpenJPAEntityManagerpublic void retrieve(Object entity)
OpenJPAEntityManager
retrieve in interface OpenJPAEntityManagerpublic void retrieveAll(Collection entities)
OpenJPAEntityManager
retrieveAll in interface OpenJPAEntityManagerOpenJPAEntityManager.retrieve(java.lang.Object)public void retrieveAll(Object... entities)
OpenJPAEntityManager
retrieveAll in interface OpenJPAEntityManagerOpenJPAEntityManager.retrieve(java.lang.Object)public void evict(Object entity)
OpenJPAEntityManager
evict in interface OpenJPAEntityManagerpublic void evictAll(Collection entities)
OpenJPAEntityManager
evictAll in interface OpenJPAEntityManagerpublic void evictAll(Object... entities)
OpenJPAEntityManager
evictAll in interface OpenJPAEntityManagerpublic void evictAll()
OpenJPAEntityManager
evictAll in interface OpenJPAEntityManagerpublic void evictAll(Class cls)
OpenJPAEntityManager
evictAll in interface OpenJPAEntityManagerpublic void evictAll(Extent extent)
OpenJPAEntityManagerExtent.
evictAll in interface OpenJPAEntityManagerpublic <T> T detach(T entity)
OpenJPAEntityManager
detach in interface OpenJPAEntityManagerentity - the instance to detach
public Object[] detachAll(Object... entities)
OpenJPAEntityManager
detachAll in interface OpenJPAEntityManagerentities - the instances to detach
public Collection detachAll(Collection entities)
OpenJPAEntityManager
detachAll in interface OpenJPAEntityManagerentities - the instances to detach
public <T> T merge(T entity)
public Object[] mergeAll(Object... entities)
OpenJPAEntityManager
mergeAll in interface OpenJPAEntityManagerentities - instances to import
public Collection mergeAll(Collection entities)
OpenJPAEntityManager
mergeAll in interface OpenJPAEntityManagerentities - Collection of instances to import
public void transactional(Object entity,
boolean updateVersion)
OpenJPAEntityManager
transactional in interface OpenJPAEntityManagerentity - instance to make transactionalupdateVersion - if true, the instance's version will be
incremented at the next flush
public void transactionalAll(Collection objs,
boolean updateVersion)
OpenJPAEntityManager
transactionalAll in interface OpenJPAEntityManagerobjs - instances to make transactionalupdateVersion - if true, the instance's version will be
incremented at the next flush
public void transactionalAll(Object[] objs,
boolean updateVersion)
OpenJPAEntityManager
transactionalAll in interface OpenJPAEntityManagerobjs - instances to make transactionalupdateVersion - if true, the instance's version will be
incremented at the next flushpublic void nontransactional(Object entity)
OpenJPAEntityManager
nontransactional in interface OpenJPAEntityManagerpublic void nontransactionalAll(Collection objs)
OpenJPAEntityManager
nontransactionalAll in interface OpenJPAEntityManagerpublic void nontransactionalAll(Object[] objs)
OpenJPAEntityManager
nontransactionalAll in interface OpenJPAEntityManagerpublic Generator getNamedGenerator(String name)
OpenJPAEntityManager
getNamedGenerator in interface OpenJPAEntityManagerpublic Generator getIdGenerator(Class forClass)
OpenJPAEntityManagerGenerator for the datastore identity values of the
specified type, or null if the type is unmanaged or its identity
cannot be represented by a sequence.
getIdGenerator in interface OpenJPAEntityManager
public Generator getFieldGenerator(Class forClass,
String fieldName)
OpenJPAEntityManagerGenerator for the generated values of the specified
type, or null if the field is not generated.
getFieldGenerator in interface OpenJPAEntityManager
public <T> Extent<T> createExtent(Class<T> cls,
boolean subclasses)
OpenJPAEntityManager
createExtent in interface OpenJPAEntityManagerpublic OpenJPAQuery createQuery(String query)
createQuery in interface OpenJPAEntityManager
public OpenJPAQuery createQuery(String language,
String query)
OpenJPAEntityManager
createQuery in interface OpenJPAEntityManagerpublic OpenJPAQuery createNamedQuery(String name)
createNamedQuery in interface OpenJPAEntityManagerpublic OpenJPAQuery createNativeQuery(String query)
createNativeQuery in interface OpenJPAEntityManager
public OpenJPAQuery createNativeQuery(String query,
Class cls)
createNativeQuery in interface OpenJPAEntityManager
public OpenJPAQuery createNativeQuery(String query,
String mappingName)
createNativeQuery in interface OpenJPAEntityManagerpublic void setFlushMode(FlushModeType flushMode)
public FlushModeType getFlushMode()
public void clear()
public Object getDelegate()
public LockModeType getLockMode(Object entity)
OpenJPAEntityManager
getLockMode in interface OpenJPAEntityManager
public void lock(Object entity,
LockModeType mode)
public void lock(Object entity)
OpenJPAEntityManagerFetchPlan for the entity manager.
lock in interface OpenJPAEntityManager
public void lock(Object entity,
LockModeType mode,
int timeout)
OpenJPAEntityManager
lock in interface OpenJPAEntityManagerentity - the object to lockmode - the lock level to usetimeout - the number of milliseconds to wait for the lock before
giving up, or -1 for no limitpublic void lockAll(Collection entities)
OpenJPAEntityManagerFetchPlan for the entity manager.
lockAll in interface OpenJPAEntityManager
public void lockAll(Collection entities,
LockModeType mode,
int timeout)
OpenJPAEntityManager
lockAll in interface OpenJPAEntityManagerentities - the objects to lockmode - the lock level to usetimeout - the number of milliseconds to wait for the lock before
giving up, or -1 for no limitpublic void lockAll(Object... entities)
OpenJPAEntityManagerFetchPlan for the entity manager.
lockAll in interface OpenJPAEntityManager
public void lockAll(Object[] entities,
LockModeType mode,
int timeout)
OpenJPAEntityManager
lockAll in interface OpenJPAEntityManagerentities - the objects to lockmode - the lock level to usetimeout - the number of milliseconds to wait for the lock before
giving up, or -1 for no limitpublic boolean cancelAll()
OpenJPAEntityManager
cancelAll in interface OpenJPAEntityManagerpublic Object getConnection()
OpenJPAEntityManager
getConnection in interface OpenJPAEntityManagerpublic Collection getManagedObjects()
OpenJPAEntityManager
getManagedObjects in interface OpenJPAEntityManagerpublic Collection getTransactionalObjects()
OpenJPAEntityManager
getTransactionalObjects in interface OpenJPAEntityManagerpublic Collection getPendingTransactionalObjects()
OpenJPAEntityManager
getPendingTransactionalObjects in interface OpenJPAEntityManagerpublic Collection getDirtyObjects()
OpenJPAEntityManager
getDirtyObjects in interface OpenJPAEntityManagerpublic boolean getOrderDirtyObjects()
OpenJPAEntityManager
getOrderDirtyObjects in interface OpenJPAEntityManagerpublic void setOrderDirtyObjects(boolean order)
OpenJPAEntityManager
setOrderDirtyObjects in interface OpenJPAEntityManagerpublic void dirtyClass(Class cls)
OpenJPAEntityManager
dirtyClass in interface OpenJPAEntityManagerpublic Collection<Class> getPersistedClasses()
OpenJPAEntityManager
getPersistedClasses in interface OpenJPAEntityManagerpublic Collection<Class> getUpdatedClasses()
OpenJPAEntityManager
getUpdatedClasses in interface OpenJPAEntityManagerpublic Collection<Class> getRemovedClasses()
OpenJPAEntityManager
getRemovedClasses in interface OpenJPAEntityManagerpublic <T> T createInstance(Class<T> cls)
OpenJPAEntityManagercls. If cls is
an interface or an abstract class whose abstract methods follow the
JavaBeans convention, this method will create a concrete implementation
according to the metadata that defines the class. If cls
is a non-final concrete type that has metadata but does not implement
PersistenceCapable, this method will create a
subclass of the type that does implement
PersistenceCapable,
following the property-based persistent attribute access rules, or
will raise an exception if the class does not meet the requirements
for subclassing. Otherwise, this will return an instance of the
specified class.
createInstance in interface OpenJPAEntityManagerpublic void close()
close in interface Closeablepublic boolean isOpen()
public void dirty(Object o,
String field)
OpenJPAEntityManager
dirty in interface OpenJPAEntityManagerpublic Object getObjectId(Object o)
OpenJPAEntityManager
getObjectId in interface OpenJPAEntityManagerpublic boolean isDirty(Object o)
OpenJPAEntityManager
isDirty in interface OpenJPAEntityManagerpublic boolean isTransactional(Object o)
OpenJPAEntityManager
isTransactional in interface OpenJPAEntityManagerpublic boolean isPersistent(Object o)
OpenJPAEntityManager
isPersistent in interface OpenJPAEntityManagerpublic boolean isNewlyPersistent(Object o)
OpenJPAEntityManager
isNewlyPersistent in interface OpenJPAEntityManagerpublic boolean isRemoved(Object o)
OpenJPAEntityManager
isRemoved in interface OpenJPAEntityManagerpublic boolean isDetached(Object entity)
OpenJPAEntityManagertrue if pc is a detached object
(one that can be reattached to a EntityManager via a call
to EntityManager#merge); otherwise returns
false.
isDetached in interface OpenJPAEntityManagerpublic Object getVersion(Object o)
OpenJPAEntityManagero.
getVersion in interface OpenJPAEntityManagerpublic Object processArgument(Object arg)
FindCallbacksOpenJPAException for illegal value.
processArgument in interface FindCallbacks
public Object processReturn(Object oid,
OpenJPAStateManager sm)
FindCallbacks
processReturn in interface FindCallbacks
public int processArgument(int op,
Object obj,
OpenJPAStateManager sm)
OpCallbacksOpenJPAException for illegal value.
processArgument in interface OpCallbacksop - the operation constantobj - the object passed to the operationsm - the argument's state manager, or null if none
public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||