|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OpenJPAEntityManager
Interface implemented by OpenJPA entity managers.
This interface extends EntityTransaction
, but this extension is
deprecated.
Field Summary | |
---|---|
static int |
CALLBACK_FAIL_FAST
Deprecated. use the CallbackMode enum instead. |
static int |
CALLBACK_IGNORE
Deprecated. use the CallbackMode enum instead. |
static int |
CALLBACK_LOG
Deprecated. use the CallbackMode enum instead. |
static int |
CALLBACK_RETHROW
Deprecated. use the CallbackMode enum instead. |
static int |
CALLBACK_ROLLBACK
Deprecated. use the CallbackMode enum instead. |
static int |
CLEAR_ALL
Deprecated. use the AutoClearType enum instead. |
static int |
CLEAR_DATASTORE
Deprecated. use the AutoClearType enum instead. |
static int |
CONN_RETAIN_ALWAYS
Deprecated. use the ConnectionRetainMode enum instead. |
static int |
CONN_RETAIN_DEMAND
Deprecated. use the ConnectionRetainMode enum instead. |
static int |
CONN_RETAIN_TRANS
Deprecated. use the ConnectionRetainMode enum instead. |
static int |
DETACH_ALL
Deprecated. use the DetachStateType enum instead. |
static int |
DETACH_CLOSE
Deprecated. use the AutoDetachType enum instead. |
static int |
DETACH_COMMIT
Deprecated. use the AutoDetachType enum instead. |
static int |
DETACH_FETCH_GROUPS
Deprecated. use the DetachStateType enum instead. |
static int |
DETACH_FGS
Deprecated. use the DetachStateType enum instead. |
static int |
DETACH_LOADED
Deprecated. use the DetachStateType enum instead. |
static int |
DETACH_NONTXREAD
Deprecated. use the AutoDetachType enum instead. |
static int |
DETACH_ROLLBACK
Deprecated. use the AutoDetachType enum instead. |
static int |
RESTORE_ALL
Deprecated. use the RestoreStateType enum instead. |
static int |
RESTORE_IMMUTABLE
Deprecated. use the RestoreStateType enum instead. |
static int |
RESTORE_NONE
Deprecated. use the RestoreStateType enum instead. |
Method Summary | ||
---|---|---|
void |
addLifecycleListener(Object listener,
Class... classes)
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
void |
addTransactionListener(Object listener)
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
void |
begin()
Deprecated. use EntityTransaction.begin()
instead: em.getTransaction().begin() |
|
void |
beginStore()
Begins a store transaction if one isn't already started. |
|
boolean |
cancelAll()
Cancel all pending data store statements. |
|
void |
commit()
Deprecated. use EntityTransaction.commit()
instead: em.getTransaction().commit() |
|
void |
commitAndResume()
Deprecated. use OpenJPAEntityTransaction.commitAndResume() instead:
em.getTransaction().commitAndResume() |
|
boolean |
containsAll(Collection pcs)
Whether the given objects are managed. |
|
boolean |
containsAll(Object... pcs)
Whether the given objects are managed. |
|
OpenJPAQuery |
createDynamicQuery(QueryDefinition dynamic)
Create an executable query from a dynamically defined query. |
|
|
createExtent(Class<T> cls,
boolean subs)
Return an extent of the given class, optionally including subclasses. |
|
|
createInstance(Class<T> cls)
Create a new instance of type cls . |
|
OpenJPAQuery |
createNamedQuery(String name)
|
|
OpenJPAQuery |
createNativeQuery(String sql)
|
|
OpenJPAQuery |
createNativeQuery(String sql,
Class resultClass)
|
|
OpenJPAQuery |
createNativeQuery(String sql,
String resultMapping)
|
|
OpenJPAQuery |
createQuery(Query query)
Create a new query from the given one. |
|
OpenJPAQuery |
createQuery(String query)
|
|
OpenJPAQuery |
createQuery(String language,
String query)
Create a new query in the given language. |
|
Collection |
detachAll(Collection pcs)
Detach the specified objects from the entity manager. |
|
Object[] |
detachAll(Object... pcs)
Detach the specified objects from the entity manager. |
|
|
detachCopy(T pc)
Detach the specified object from the entity manager, detaching based on the AutoDetach value specified and returning a copy of the detached entity. |
|
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. |
|
void |
evict(Object pc)
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 pcs)
Evict the given objects. |
|
void |
evictAll(Extent extent)
Evict all persistent-clean and persistent-nontransactional instances in the given Extent . |
|
void |
evictAll(Object... pcs)
Evict the given objects. |
|
|
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. |
|
AutoClearType |
getAutoClear()
Whether to clear state when entering a transaction. |
|
EnumSet<AutoDetachType> |
getAutoDetach()
AutoDetachType values which indicate when persistent
managed objects should be automatically detached in-place. |
|
ClassLoader |
getClassLoader()
Return the current thread's class loader at the time this entity manager was obtained from the factory. |
|
OpenJPAConfiguration |
getConfiguration()
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
Object |
getConnection()
Return the connection in use by the entity manager, or a new connection if none. |
|
String |
getConnectionPassword()
Return the connection password. |
|
ConnectionRetainMode |
getConnectionRetainMode()
Return the connection retain mode for this entity manager. |
|
String |
getConnectionUserName()
Return the connection user name. |
|
OpenJPACriteriaBuilder |
getCriteriaBuilder()
Gets the QueryBuilder with OpenJPA-extended capabilities. |
|
DetachStateType |
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. |
|
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()
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
LockModeType |
getLockMode(Object pc)
Return the lock mode of the given instance, or null if not locked. |
|
Collection |
getManagedObjects()
Return a set of all managed instances. |
|
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 pcClass)
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. |
|
Collection<Class> |
getRemovedClasses()
Return the set of classes that have been deleted in the current transaction. |
|
RestoreStateType |
getRestoreState()
Whether to restore an object's original state on rollback. |
|
boolean |
getRetainState()
Whether objects retain their persistent state on transaction commit. |
|
Throwable |
getRollbackCause()
Deprecated. use OpenJPAEntityTransaction.getRollbackCause()
instead: em.getTransaction().getRollbackCause() |
|
boolean |
getRollbackOnly()
Deprecated. use EntityTransaction.getRollbackOnly()
instead: em.getTransaction().getRollbackOnly() |
|
Set<String> |
getSupportedProperties()
Get the properties supported by this runtime. |
|
boolean |
getSyncWithManagedTransactions()
Whether to check for a global transaction upon every managed, non-transactional operation. |
|
OpenJPAEntityTransaction |
getTransaction()
|
|
Collection |
getTransactionalObjects()
Return a set of current transaction instances. |
|
int |
getTransactionListenerCallbackMode()
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
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 . |
|
boolean |
isActive()
Deprecated. use EntityTransaction.isActive()
instead: em.getTransaction().isActive() |
|
boolean |
isDetached(Object o)
Returns true if pc is a detached object
(one that can be reattached to a EntityManager via a call
to EntityManager.merge(T) ); otherwise returns
false . |
|
boolean |
isDirty(Object o)
Return whether the given object is dirty. |
|
boolean |
isLargeTransaction()
Deprecated. use isTrackChangesByType() instead. |
|
boolean |
isManaged()
Deprecated. use isTransactionManaged() instead to interrogate
whether or not this EntityManager's transaction is managed. To determine
if a given entity instance is managed, use EntityManager.contains(java.lang.Object) . |
|
boolean |
isNewlyPersistent(Object o)
Return whether the given object was made persistent in the current transaction. |
|
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 |
isTrackChangesByType()
Whether memory usage is reduced during this transaction at the expense of tracking changes at the type level instead of the instance level, resulting in more aggressive cache invalidation. |
|
boolean |
isTransactional(Object o)
Return whether the given object is transactional. |
|
boolean |
isTransactionManaged()
Whether this entity manager is using managed transactions. |
|
void |
lock(Object pc)
Ensure that the given instance is locked at the current lock level, as set in the FetchPlan for the entity manager. |
|
void |
lock(Object pc,
LockModeType mode,
int timeout)
Ensure that the given instance is locked at the given lock level. |
|
void |
lockAll(Collection pcs)
Ensure that the given instances are locked at the current lock level, as set in the FetchPlan for the entity manager. |
|
void |
lockAll(Collection pcs,
LockModeType mode,
int timeout)
Ensure that the given instances are locked at the given lock level. |
|
void |
lockAll(Object... pcs)
Ensure that the given instances are locked at the current lock level, as set in the FetchPlan for the entity manager. |
|
void |
lockAll(Object[] pcs,
LockModeType mode,
int timeout)
Ensure that the given instances are locked at the given lock level. |
|
Collection |
mergeAll(Collection pcs)
Merge the specified detached objects into the entity manager. |
|
Object[] |
mergeAll(Object... pcs)
Merge the specified objects into the entity manager. |
|
void |
nontransactional(Object pc)
Make the given object nontransactional. |
|
void |
nontransactionalAll(Collection objs)
Make the given objects nontransactional. |
|
void |
nontransactionalAll(Object[] objs)
Make the given objects nontransactional. |
|
void |
persistAll(Collection pcs)
Persist the given objects. |
|
void |
persistAll(Object... pcs)
Persist the given objects. |
|
void |
popFetchPlan()
Pops the fetch plan from the top of the stack, making the next one down the active one. |
|
void |
preFlush()
Run pre-flush actions on transactional objects, including persistence-by-reachability, inverse relationship management, deletion of dependent instances, and instance callbacks. |
|
FetchPlan |
pushFetchPlan()
Pushes a new fetch plan that inherits from the current fetch plan onto a stack, and makes the new plan the active one. |
|
Object |
putUserObject(Object key,
Object val)
Put the specified key-value pair into the map of user objects. |
|
void |
refreshAll()
Refresh all transactional objects. |
|
void |
refreshAll(Collection pcs)
Refresh the state of the given objects. |
|
void |
refreshAll(Object... pcs)
Refresh the state of the given objects. |
|
void |
release(Object pc)
Release the given object from management. |
|
void |
releaseAll(Collection pcs)
Release the given objects from management. |
|
void |
releaseAll(Object... pcs)
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 |
removeAll(Collection pcs)
Delete the given persistent objects. |
|
void |
removeAll(Object... pcs)
Delete the given persistent objects. |
|
void |
removeLifecycleListener(Object listener)
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
void |
removeTransactionListener(Object listener)
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
void |
retrieve(Object pc)
Immediately load the given object's persistent fields. |
|
void |
retrieveAll(Collection pcs)
Retrieve the persistent state of the given objects. |
|
void |
retrieveAll(Object... pcs)
Retrieve the persistent state of the given objects. |
|
void |
rollback()
Deprecated. use EntityTransaction.rollback()
instead: em.getTransaction().rollback() |
|
void |
rollbackAndResume()
Deprecated. use OpenJPAEntityTransaction.rollbackAndResume()
instead: em.getTransaction().rollbackAndResume() |
|
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(AutoClearType clearType)
Whether to clear state when entering a transaction. |
|
void |
setAutoClear(int autoClear)
Deprecated. use setAutoClear(AutoClearType) instead. |
|
void |
setAutoDetach(AutoDetachType value)
AutoDetachType values which indicate when persistent
managed objects should be automatically detached in-place. |
|
void |
setAutoDetach(AutoDetachType value,
boolean on)
Bit flags marked in AutoDetachType which indicate when persistent
managed objects should be automatically detached in-place. |
|
void |
setAutoDetach(EnumSet<AutoDetachType> values)
AutoDetachType values which indicate when persistent
managed objects should be automatically detached in-place. |
|
void |
setAutoDetach(int autoDetachFlags)
Deprecated. use setAutoDetach(AutoDetachType) or
setAutoDetach(java.util.EnumSet) instead. |
|
void |
setAutoDetach(int flag,
boolean on)
Deprecated. use setAutoDetach(AutoDetachType, boolean) instead. |
|
void |
setDetachState(DetachStateType type)
Detach mode constant to determine which fields are part of the detached graph. |
|
void |
setDetachState(int detach)
Deprecated. use setDetachState(DetachStateType) instead. |
|
void |
setEvictFromStoreCache(boolean evict)
Whether to also evict an object from the store cache when it is evicted through this entity manager. |
|
void |
setIgnoreChanges(boolean ignore)
Whether to take into account changes in the transaction when executing a query or iterating an extent. |
|
void |
setLargeTransaction(boolean value)
Deprecated. use setTrackChangesByType(boolean) instead. |
|
void |
setLifecycleListenerCallbackMode(int callbackMode)
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
void |
setMultithreaded(boolean multi)
Whether the entity manager or its managed instances are used in a multithreaded environment. |
|
void |
setNontransactionalRead(boolean read)
Whether to allow nontransactional access to persistent state. |
|
void |
setNontransactionalWrite(boolean write)
Whether to allow nontransactional changes to persistent state. |
|
void |
setOptimistic(boolean opt)
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 restore)
Deprecated. use setRestoreState(RestoreStateType) instead. |
|
void |
setRestoreState(RestoreStateType restoreType)
Whether to restore an object's original state on rollback. |
|
void |
setRetainState(boolean retain)
Whether objects retain their persistent state on transaction commit. |
|
void |
setRollbackOnly()
Deprecated. use EntityTransaction.setRollbackOnly()
instead: em.getTransaction().setRollbackOnly() |
|
void |
setRollbackOnly(Throwable cause)
Deprecated. use OpenJPAEntityTransaction.setRollbackOnly(java.lang.Throwable)
instead: em.getTransaction().setRollbackOnly() |
|
void |
setSavepoint(String name)
Set a transactional savepoint where operations after this savepoint will be rolled back. |
|
void |
setSyncWithManagedTransactions(boolean resync)
Whether to check for a global transaction upon every managed, non-transactional operation. |
|
void |
setTrackChangesByType(boolean track)
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 by tracking changes at the type level instead of the instance level, resulting in more aggressive cache invalidation. |
|
void |
setTransactionListenerCallbackMode(int callbackMode)
Deprecated. cast to OpenJPAEntityManagerSPI instead. This
method pierces the published-API boundary, as does the SPI cast. |
|
void |
transactional(Object pc,
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 interface javax.persistence.EntityManager |
---|
clear, close, contains, createNamedQuery, createQuery, createQuery, detach, find, find, find, find, flush, getDelegate, getFlushMode, getMetamodel, getProperties, getReference, isOpen, joinTransaction, lock, lock, merge, persist, refresh, refresh, refresh, refresh, remove, setFlushMode, setProperty, unwrap |
Field Detail |
---|
static final int CONN_RETAIN_DEMAND
ConnectionRetainMode
enum instead.static final int CONN_RETAIN_TRANS
ConnectionRetainMode
enum instead.static final int CONN_RETAIN_ALWAYS
ConnectionRetainMode
enum instead.static final int DETACH_FETCH_GROUPS
DetachStateType
enum instead.static final int DETACH_FGS
DetachStateType
enum instead.static final int DETACH_LOADED
DetachStateType
enum instead.static final int DETACH_ALL
DetachStateType
enum instead.static final int RESTORE_NONE
RestoreStateType
enum instead.static final int RESTORE_IMMUTABLE
RestoreStateType
enum instead.static final int RESTORE_ALL
RestoreStateType
enum instead.static final int DETACH_CLOSE
AutoDetachType
enum instead.static final int DETACH_COMMIT
AutoDetachType
enum instead.static final int DETACH_NONTXREAD
AutoDetachType
enum instead.static final int DETACH_ROLLBACK
AutoDetachType
enum instead.static final int CLEAR_DATASTORE
AutoClearType
enum instead.static final int CLEAR_ALL
AutoClearType
enum instead.static final int CALLBACK_FAIL_FAST
CallbackMode
enum instead.static final int CALLBACK_IGNORE
CallbackMode
enum instead.static final int CALLBACK_LOG
CallbackMode
enum instead.static final int CALLBACK_RETHROW
CallbackMode
enum instead.static final int CALLBACK_ROLLBACK
CallbackMode
enum instead.Method Detail |
---|
OpenJPAEntityManagerFactory getEntityManagerFactory()
getEntityManagerFactory
in interface EntityManager
FetchPlan getFetchPlan()
FetchPlan pushFetchPlan()
void popFetchPlan()
ConnectionRetainMode getConnectionRetainMode()
boolean isTransactionManaged()
boolean isManaged()
isTransactionManaged()
instead to interrogate
whether or not this EntityManager's transaction is managed. To determine
if a given entity instance is managed, use EntityManager.contains(java.lang.Object)
.
boolean getSyncWithManagedTransactions()
void setSyncWithManagedTransactions(boolean resync)
ClassLoader getClassLoader()
String getConnectionUserName()
String getConnectionPassword()
boolean getMultithreaded()
void setMultithreaded(boolean multi)
boolean getIgnoreChanges()
void setIgnoreChanges(boolean ignore)
boolean getNontransactionalRead()
void setNontransactionalRead(boolean read)
boolean getNontransactionalWrite()
void setNontransactionalWrite(boolean write)
boolean getOptimistic()
void setOptimistic(boolean opt)
RestoreStateType getRestoreState()
void setRestoreState(RestoreStateType restoreType)
boolean getRetainState()
void setRetainState(boolean retain)
DetachStateType getDetachState()
void setDetachState(DetachStateType type)
AutoClearType getAutoClear()
void setAutoClear(AutoClearType clearType)
EnumSet<AutoDetachType> getAutoDetach()
AutoDetachType
values which indicate when persistent
managed objects should be automatically detached in-place.
void setAutoDetach(AutoDetachType value)
AutoDetachType
values which indicate when persistent
managed objects should be automatically detached in-place.
The current value is replaced in its entirety.
void setAutoDetach(EnumSet<AutoDetachType> values)
AutoDetachType
values which indicate when persistent
managed objects should be automatically detached in-place.
The current value is replaced in its entirety.
void setAutoDetach(AutoDetachType value, boolean on)
AutoDetachType
which indicate when persistent
managed objects should be automatically detached in-place.
boolean getEvictFromStoreCache()
void setEvictFromStoreCache(boolean evict)
boolean getPopulateStoreCache()
void setPopulateStoreCache(boolean cache)
boolean isTrackChangesByType()
void setTrackChangesByType(boolean track)
Object putUserObject(Object key, Object val)
Object getUserObject(Object key)
<T> T[] findAll(Class<T> cls, Object... oids)
oids
- the oids of the objects to return
EntityManager.find(Class,Object)
<T> Collection<T> findAll(Class<T> cls, Collection oids)
oids
- the oids of the objects to return
EntityManager.find(Class,Object)
<T> T findCached(Class<T> cls, Object oid)
oid
- the object's id
Class getObjectIdClass(Class pcClass)
OpenJPAEntityTransaction getTransaction()
getTransaction
in interface EntityManager
void setSavepoint(String name)
void rollbackToSavepoint()
void rollbackToSavepoint(String name)
void releaseSavepoint()
void releaseSavepoint(String name)
void preFlush()
void validateChanges()
EntityManager.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.
boolean isStoreActive()
void beginStore()
boolean containsAll(Object... pcs)
boolean containsAll(Collection pcs)
void persistAll(Object... pcs)
void persistAll(Collection pcs)
void removeAll(Object... pcs)
void removeAll(Collection pcs)
void release(Object pc)
void releaseAll(Object... pcs)
void releaseAll(Collection pcs)
void retrieve(Object pc)
void retrieveAll(Object... pcs)
retrieve(java.lang.Object)
void retrieveAll(Collection pcs)
retrieve(java.lang.Object)
void refreshAll(Object... pcs)
void refreshAll(Collection pcs)
void refreshAll()
void evict(Object pc)
void evictAll(Object... pcs)
void evictAll(Collection pcs)
void evictAll()
void evictAll(Class cls)
void evictAll(Extent extent)
Extent
.
<T> T detachCopy(T pc)
pc
- the instance to detach
Collection detachAll(Collection pcs)
pcs
- the instances to detach
Object[] detachAll(Object... pcs)
pcs
- the instances to detach
Object[] mergeAll(Object... pcs)
pcs
- instances to import
Collection mergeAll(Collection pcs)
pcs
- Collection of instances to import
void transactional(Object pc, boolean updateVersion)
pc
- instance to make transactionalupdateVersion
- if true, the instance's version will be
incremented at the next flushvoid transactionalAll(Collection objs, boolean updateVersion)
objs
- instances to make transactionalupdateVersion
- if true, the instance's version will be
incremented at the next flushvoid transactionalAll(Object[] objs, boolean updateVersion)
objs
- instances to make transactionalupdateVersion
- if true, the instance's version will be
incremented at the next flushvoid nontransactional(Object pc)
void nontransactionalAll(Collection objs)
void nontransactionalAll(Object[] objs)
Generator getNamedGenerator(String name)
Generator getIdGenerator(Class forClass)
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.
Generator getFieldGenerator(Class forClass, String fieldName)
Generator
for the generated values of the specified
type, or null if the field is not generated.
<T> Extent<T> createExtent(Class<T> cls, boolean subs)
OpenJPAQuery createQuery(String query)
createQuery
in interface EntityManager
OpenJPAQuery createNamedQuery(String name)
createNamedQuery
in interface EntityManager
OpenJPAQuery createNativeQuery(String sql)
createNativeQuery
in interface EntityManager
OpenJPAQuery createNativeQuery(String sql, Class resultClass)
createNativeQuery
in interface EntityManager
OpenJPAQuery createNativeQuery(String sql, String resultMapping)
createNativeQuery
in interface EntityManager
OpenJPAQuery createQuery(Query query)
OpenJPAQuery createQuery(String language, String query)
OpenJPAQuery createDynamicQuery(QueryDefinition dynamic)
LockModeType getLockMode(Object pc)
getLockMode
in interface EntityManager
void lock(Object pc, LockModeType mode, int timeout)
pc
- 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 limitvoid lock(Object pc)
FetchPlan
for the entity manager.
void lockAll(Collection pcs, LockModeType mode, int timeout)
pcs
- 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 limitvoid lockAll(Collection pcs)
FetchPlan
for the entity manager.
void lockAll(Object[] pcs, LockModeType mode, int timeout)
pcs
- 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 limitvoid lockAll(Object... pcs)
FetchPlan
for the entity manager.
boolean cancelAll()
Object getConnection()
Collection getManagedObjects()
Collection getTransactionalObjects()
Collection getPendingTransactionalObjects()
Collection getDirtyObjects()
boolean getOrderDirtyObjects()
void setOrderDirtyObjects(boolean order)
void dirtyClass(Class cls)
Collection<Class> getPersistedClasses()
Collection<Class> getRemovedClasses()
Collection<Class> getUpdatedClasses()
<T> T createInstance(Class<T> cls)
cls
. 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
, and will attempt
to redefine the methods in cls
to enable persistent
attribute tracking. Otherwise, if cls
is a managed type,
this will return an instance of the specified class.
IllegalArgumentException
- if cls
is not a managed
type or interface.void dirty(Object o, String field)
Object getObjectId(Object o)
boolean isDirty(Object o)
boolean isTransactional(Object o)
boolean isPersistent(Object o)
boolean isNewlyPersistent(Object o)
boolean isRemoved(Object o)
boolean isDetached(Object o)
true
if pc
is a detached object
(one that can be reattached to a EntityManager
via a call
to EntityManager.merge(T)
); otherwise returns
false
.
Object getVersion(Object o)
o
.
OpenJPAConfiguration getConfiguration()
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
void setRestoreState(int restore)
setRestoreState(RestoreStateType)
instead.
void setDetachState(int detach)
setDetachState(DetachStateType)
instead.
void setAutoClear(int autoClear)
setAutoClear(AutoClearType)
instead.
void setAutoDetach(int autoDetachFlags)
setAutoDetach(AutoDetachType)
or
setAutoDetach(java.util.EnumSet)
instead.
void setAutoDetach(int flag, boolean on)
setAutoDetach(AutoDetachType, boolean)
instead.
boolean isLargeTransaction()
isTrackChangesByType()
instead.
void setLargeTransaction(boolean value)
setTrackChangesByType(boolean)
instead.
void addTransactionListener(Object listener)
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
void removeTransactionListener(Object listener)
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
int getTransactionListenerCallbackMode()
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
void setTransactionListenerCallbackMode(int callbackMode)
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
void addLifecycleListener(Object listener, Class... classes)
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
void removeLifecycleListener(Object listener)
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
int getLifecycleListenerCallbackMode()
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
void setLifecycleListenerCallbackMode(int callbackMode)
OpenJPAEntityManagerSPI
instead. This
method pierces the published-API boundary, as does the SPI cast.
void begin()
EntityTransaction.begin()
instead: em.getTransaction().begin()
begin
in interface EntityTransaction
void commit()
EntityTransaction.commit()
instead: em.getTransaction().commit()
commit
in interface EntityTransaction
void rollback()
EntityTransaction.rollback()
instead: em.getTransaction().rollback()
rollback
in interface EntityTransaction
boolean isActive()
EntityTransaction.isActive()
instead: em.getTransaction().isActive()
isActive
in interface EntityTransaction
void commitAndResume()
OpenJPAEntityTransaction.commitAndResume()
instead:
em.getTransaction().commitAndResume()
void rollbackAndResume()
OpenJPAEntityTransaction.rollbackAndResume()
instead: em.getTransaction().rollbackAndResume()
void setRollbackOnly()
EntityTransaction.setRollbackOnly()
instead: em.getTransaction().setRollbackOnly()
setRollbackOnly
in interface EntityTransaction
void setRollbackOnly(Throwable cause)
OpenJPAEntityTransaction.setRollbackOnly(java.lang.Throwable)
instead: em.getTransaction().setRollbackOnly()
Throwable getRollbackCause()
OpenJPAEntityTransaction.getRollbackCause()
instead: em.getTransaction().getRollbackCause()
boolean getRollbackOnly()
EntityTransaction.getRollbackOnly()
instead: em.getTransaction().getRollbackOnly()
getRollbackOnly
in interface EntityTransaction
OpenJPACriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder
in interface EntityManager
Set<String> getSupportedProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |