public class EntityManagerImpl extends Object implements OpenJPAEntityManagerSPI, Externalizable, FindCallbacks, OpCallbacks, Closeable, OpenJPAEntityTransaction
EntityManager interface.| Modifier and Type | Field and Description |
|---|---|
protected RuntimeExceptionTranslator |
_ret |
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK, CLEAR_ALL, CLEAR_DATASTORE, CONN_RETAIN_ALWAYS, CONN_RETAIN_DEMAND, CONN_RETAIN_TRANS, DETACH_ALL, DETACH_CLOSE, DETACH_COMMIT, DETACH_FETCH_GROUPS, DETACH_FGS, DETACH_LOADED, DETACH_NONTXREAD, DETACH_ROLLBACK, RESTORE_ALL, RESTORE_IMMUTABLE, RESTORE_NONEACT_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 and Description |
|---|
EntityManagerImpl() |
EntityManagerImpl(EntityManagerFactoryImpl factory,
Broker broker)
Constructor; supply factory and delegate.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected void |
assertNotCloseInvoked()
Throw appropriate exception if close has been invoked but the broker
is still open.
|
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.
|
OpenJPAQuery |
createDynamicQuery(QueryDefinition qdef)
Create an executable query from a dynamically defined query.
|
<T> javax.persistence.EntityGraph<T> |
createEntityGraph(Class<T> rootType) |
javax.persistence.EntityGraph<?> |
createEntityGraph(String graphName) |
<T> Extent<T> |
createExtent(Class<T> cls,
boolean subclasses)
Return an extent of the given class, optionally including subclasses.
|
<T> T |
createInstance(Class<T> cls)
Create a new instance of type
cls. |
OpenJPAQuery |
createNamedQuery(String name) |
<T> javax.persistence.TypedQuery<T> |
createNamedQuery(String name,
Class<T> resultClass) |
javax.persistence.StoredProcedureQuery |
createNamedStoredProcedureQuery(String name) |
OpenJPAQuery |
createNativeQuery(String query) |
OpenJPAQuery |
createNativeQuery(String query,
Class cls) |
OpenJPAQuery |
createNativeQuery(String query,
String mappingName) |
javax.persistence.Query |
createQuery(javax.persistence.criteria.CriteriaDelete deleteQuery) |
<T> javax.persistence.TypedQuery<T> |
createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
Create a query from the given CritriaQuery.
|
javax.persistence.Query |
createQuery(javax.persistence.criteria.CriteriaUpdate updateQuery) |
OpenJPAQuery |
createQuery(javax.persistence.Query query)
Create a new query from the given one.
|
OpenJPAQuery |
createQuery(String query) |
<T> javax.persistence.TypedQuery<T> |
createQuery(String query,
Class<T> resultClass) |
OpenJPAQuery |
createQuery(String language,
String query)
Create a new query in the given language.
|
javax.persistence.StoredProcedureQuery |
createStoredProcedureQuery(String procedureName) |
javax.persistence.StoredProcedureQuery |
createStoredProcedureQuery(String procedureName,
Class... resultClasses) |
javax.persistence.StoredProcedureQuery |
createStoredProcedureQuery(String procedureName,
String... resultSetMappings) |
void |
detach(Object entity) |
Collection |
detachAll(Collection entities)
Detach the specified objects from the entity manager.
|
Object[] |
detachAll(Object... entities)
Detach the specified objects from the entity manager.
|
<T> T |
detachCopy(T entity)
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.
|
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.
|
<T> T |
find(Class<T> cls,
Object oid) |
<T> T |
find(Class<T> cls,
Object oid,
javax.persistence.LockModeType mode) |
<T> T |
find(Class<T> cls,
Object oid,
javax.persistence.LockModeType mode,
Map<String,Object> properties) |
<T> T |
find(Class<T> cls,
Object oid,
Map<String,Object> properties) |
<T> Collection<T> |
findAll(Class<T> cls,
Collection oids)
Return the objects with the given oids.
|
<T> T[] |
findAll(Class<T> cls,
Object... oids)
Return the objects with the given oids.
|
<T> T |
findCached(Class<T> cls,
Object oid)
Return the cached instance for the given oid/object, or null if not
cached.
|
void |
flush() |
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. |
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.
|
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.
|
Object |
getDelegate() |
DetachStateType |
getDetachState()
Detach mode constant to determine which fields are part of the
detached graph.
|
Collection |
getDirtyObjects()
Return a set of current dirty instances.
|
javax.persistence.EntityGraph<?> |
getEntityGraph(String graphName) |
<T> List<javax.persistence.EntityGraph<? super T>> |
getEntityGraphs(Class<T> entityClass) |
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. |
javax.persistence.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() |
EnumSet<CallbackMode> |
getLifecycleListenerCallbackModes()
The
CallbackMode flags for handling lifecycle listener
exceptions. |
javax.persistence.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.
|
javax.persistence.metamodel.Metamodel |
getMetamodel() |
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.
|
Map<String,Object> |
getProperties()
Get the properties used currently by this entity manager.
|
boolean |
getQuerySQLCache()
Affirms if this receiver is caching database queries.
|
<T> T |
getReference(Class<T> cls,
Object oid) |
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()
Returns the Throwable that caused the transaction to be
marked for rollback.
|
boolean |
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() |
EnumSet<CallbackMode> |
getTransactionListenerCallbackModes()
The
CallbackMode 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(T)); otherwise returns
false. |
boolean |
isDirty(Object o)
Return whether the given object is dirty.
|
boolean |
isJoinedToTransaction() |
boolean |
isLargeTransaction() |
boolean |
isManaged() |
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 |
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 |
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,
javax.persistence.LockModeType mode) |
void |
lock(Object entity,
javax.persistence.LockModeType mode,
int timeout)
Ensure that the given instance is locked at the given lock level.
|
void |
lock(Object entity,
javax.persistence.LockModeType mode,
Map<String,Object> properties) |
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,
javax.persistence.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,
javax.persistence.LockModeType mode,
int timeout)
Ensure that the given instances are locked at the given lock level.
|
<T> T |
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.
|
protected <T> QueryImpl<T> |
newQueryImpl(Query kernelQuery) |
protected <T> QueryImpl<T> |
newQueryImpl(Query kernelQuery,
QueryMetaData qmd) |
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 |
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.
|
void |
prepareForPooling()
Deprecated.
- use
clear() instead. |
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.
|
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.
|
FetchPlan |
pushFetchPlan(FetchConfiguration fc) |
Object |
putUserObject(Object key,
Object val)
Put the specified key-value pair into the map of user objects.
|
void |
readExternal(ObjectInput in) |
void |
refresh(Object entity) |
void |
refresh(Object entity,
javax.persistence.LockModeType mode) |
void |
refresh(Object entity,
javax.persistence.LockModeType mode,
Map<String,Object> properties) |
void |
refresh(Object entity,
Map<String,Object> properties) |
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(AutoClearType val)
Whether to clear state when entering a transaction.
|
void |
setAutoClear(int autoClear) |
void |
setAutoDetach(AutoDetachType flag)
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> flags)
AutoDetachType values which indicate when persistent
managed objects should be automatically detached in-place. |
void |
setAutoDetach(int autoDetachFlags) |
void |
setAutoDetach(int flag,
boolean on) |
void |
setDetachState(DetachStateType type)
Detach mode constant to determine which fields are part of the
detached graph.
|
void |
setDetachState(int detach) |
void |
setEvictFromStoreCache(boolean evict)
Whether to also evict an object from the store cache when it is
evicted through this entity manager.
|
void |
setFlushMode(javax.persistence.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 value) |
void |
setLifecycleListenerCallbackMode(CallbackMode mode)
The
CallbackMode flag for handling lifecycle listener
exceptions. |
void |
setLifecycleListenerCallbackMode(EnumSet<CallbackMode> modes)
The
CallbackMode flags for handling lifecycle listener
exceptions. |
void |
setLifecycleListenerCallbackMode(int callbackMode) |
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 |
setProperties(Map<String,Object> emEmptyPropsProperties) |
void |
setProperty(String prop,
Object value)
Sets the given property to the given value, reflectively.
|
void |
setQuerySQLCache(boolean flag)
Sets whether this receiver will cache database queries during its
lifetime.
|
void |
setRestoreState(int restore) |
void |
setRestoreState(RestoreStateType 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() |
void |
setRollbackOnly(Throwable cause)
Mark the current transaction for rollback with the specified cause
of the 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 |
setTrackChangesByType(boolean trackByType)
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(CallbackMode mode)
The
CallbackMode flag for handling transaction listener
exceptions. |
void |
setTransactionListenerCallbackMode(EnumSet<CallbackMode> modes)
The
CallbackMode flags for handling transaction listener
exceptions. |
void |
setTransactionListenerCallbackMode(int callbackMode) |
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.
|
<T> T |
unwrap(Class<T> cls)
Unwraps this receiver to an instance of the given class, if possible.
|
void |
validateChanges()
Validate the changes made in this transaction, reporting any optimistic
violations, constraint violations, etc.
|
protected void |
validateSQL(String query)
Validate that the user provided SQL.
|
void |
writeExternal(ObjectOutput out) |
protected RuntimeExceptionTranslator _ret
public EntityManagerImpl()
public EntityManagerImpl(EntityManagerFactoryImpl factory, Broker broker)
public Broker getBroker()
public OpenJPAEntityManagerFactory getEntityManagerFactory()
OpenJPAEntityManagergetEntityManagerFactory in interface javax.persistence.EntityManagergetEntityManagerFactory in interface OpenJPAEntityManagerpublic OpenJPAConfiguration getConfiguration()
OpenJPAEntityManagerSPIgetConfiguration in interface OpenJPAEntityManagergetConfiguration in interface OpenJPAEntityManagerSPIpublic FetchPlan getFetchPlan()
OpenJPAEntityManagergetFetchPlan in interface OpenJPAEntityManagerpublic FetchPlan pushFetchPlan()
OpenJPAEntityManagerpushFetchPlan in interface OpenJPAEntityManagerpublic FetchPlan pushFetchPlan(FetchConfiguration fc)
public void popFetchPlan()
OpenJPAEntityManagerpopFetchPlan in interface OpenJPAEntityManagerpublic ConnectionRetainMode getConnectionRetainMode()
OpenJPAEntityManagergetConnectionRetainMode in interface OpenJPAEntityManagerpublic boolean isTransactionManaged()
OpenJPAEntityManagerisTransactionManaged in interface OpenJPAEntityManagerpublic boolean isManaged()
isManaged in interface OpenJPAEntityManagerpublic ManagedRuntime getManagedRuntime()
OpenJPAEntityManagerSPIgetManagedRuntime in interface OpenJPAEntityManagerSPIpublic boolean getSyncWithManagedTransactions()
OpenJPAEntityManagergetSyncWithManagedTransactions in interface OpenJPAEntityManagerpublic void setSyncWithManagedTransactions(boolean sync)
OpenJPAEntityManagersetSyncWithManagedTransactions in interface OpenJPAEntityManagerpublic ClassLoader getClassLoader()
OpenJPAEntityManagergetClassLoader in interface OpenJPAEntityManagerpublic String getConnectionUserName()
OpenJPAEntityManagergetConnectionUserName in interface OpenJPAEntityManagerpublic String getConnectionPassword()
OpenJPAEntityManagergetConnectionPassword in interface OpenJPAEntityManagerpublic boolean getMultithreaded()
OpenJPAEntityManagergetMultithreaded in interface OpenJPAEntityManagerpublic void setMultithreaded(boolean multithreaded)
OpenJPAEntityManagersetMultithreaded in interface OpenJPAEntityManagerpublic boolean getIgnoreChanges()
OpenJPAEntityManagergetIgnoreChanges in interface OpenJPAEntityManagerpublic void setIgnoreChanges(boolean val)
OpenJPAEntityManagersetIgnoreChanges in interface OpenJPAEntityManagerpublic boolean getNontransactionalRead()
OpenJPAEntityManagergetNontransactionalRead in interface OpenJPAEntityManagerpublic void setNontransactionalRead(boolean val)
OpenJPAEntityManagersetNontransactionalRead in interface OpenJPAEntityManagerpublic boolean getNontransactionalWrite()
OpenJPAEntityManagergetNontransactionalWrite in interface OpenJPAEntityManagerpublic void setNontransactionalWrite(boolean val)
OpenJPAEntityManagersetNontransactionalWrite in interface OpenJPAEntityManagerpublic boolean getOptimistic()
OpenJPAEntityManagergetOptimistic in interface OpenJPAEntityManagerpublic void setOptimistic(boolean val)
OpenJPAEntityManagersetOptimistic in interface OpenJPAEntityManagerpublic RestoreStateType getRestoreState()
OpenJPAEntityManagergetRestoreState in interface OpenJPAEntityManagerpublic void setRestoreState(RestoreStateType val)
OpenJPAEntityManagersetRestoreState in interface OpenJPAEntityManagerpublic void setRestoreState(int restore)
setRestoreState in interface OpenJPAEntityManagerpublic boolean getRetainState()
OpenJPAEntityManagergetRetainState in interface OpenJPAEntityManagerpublic void setRetainState(boolean val)
OpenJPAEntityManagersetRetainState in interface OpenJPAEntityManagerpublic AutoClearType getAutoClear()
OpenJPAEntityManagergetAutoClear in interface OpenJPAEntityManagerpublic void setAutoClear(AutoClearType val)
OpenJPAEntityManagersetAutoClear in interface OpenJPAEntityManagerpublic void setAutoClear(int autoClear)
setAutoClear in interface OpenJPAEntityManagerpublic DetachStateType getDetachState()
OpenJPAEntityManagergetDetachState in interface OpenJPAEntityManagerpublic void setDetachState(DetachStateType type)
OpenJPAEntityManagersetDetachState in interface OpenJPAEntityManagerpublic void setDetachState(int detach)
setDetachState in interface OpenJPAEntityManagerpublic EnumSet<AutoDetachType> getAutoDetach()
OpenJPAEntityManagerAutoDetachType values which indicate when persistent
managed objects should be automatically detached in-place.getAutoDetach in interface OpenJPAEntityManagerpublic void setAutoDetach(AutoDetachType flag)
OpenJPAEntityManagerAutoDetachType values which indicate when persistent
managed objects should be automatically detached in-place.
The current value is replaced in its entirety.setAutoDetach in interface OpenJPAEntityManagerpublic void setAutoDetach(EnumSet<AutoDetachType> flags)
OpenJPAEntityManagerAutoDetachType values which indicate when persistent
managed objects should be automatically detached in-place.
The current value is replaced in its entirety.setAutoDetach in interface OpenJPAEntityManagerpublic void setAutoDetach(int autoDetachFlags)
setAutoDetach in interface OpenJPAEntityManagerpublic void setAutoDetach(AutoDetachType value, boolean on)
OpenJPAEntityManagerAutoDetachType which indicate when persistent
managed objects should be automatically detached in-place.setAutoDetach in interface OpenJPAEntityManagerpublic void setAutoDetach(int flag,
boolean on)
setAutoDetach in interface OpenJPAEntityManagerpublic boolean getEvictFromStoreCache()
OpenJPAEntityManagergetEvictFromStoreCache in interface OpenJPAEntityManagerpublic void setEvictFromStoreCache(boolean evict)
OpenJPAEntityManagersetEvictFromStoreCache in interface OpenJPAEntityManagerpublic boolean getPopulateStoreCache()
OpenJPAEntityManagergetPopulateStoreCache in interface OpenJPAEntityManagerpublic void setPopulateStoreCache(boolean cache)
OpenJPAEntityManagersetPopulateStoreCache in interface OpenJPAEntityManagerpublic boolean isTrackChangesByType()
OpenJPAEntityManagerisTrackChangesByType in interface OpenJPAEntityManagerpublic void setTrackChangesByType(boolean trackByType)
OpenJPAEntityManagersetTrackChangesByType in interface OpenJPAEntityManagerpublic boolean isLargeTransaction()
isLargeTransaction in interface OpenJPAEntityManagerpublic void setLargeTransaction(boolean value)
setLargeTransaction in interface OpenJPAEntityManagerpublic Object getUserObject(Object key)
OpenJPAEntityManagergetUserObject in interface OpenJPAEntityManagerpublic Object putUserObject(Object key, Object val)
OpenJPAEntityManagerputUserObject in interface OpenJPAEntityManagerpublic void addTransactionListener(Object listener)
OpenJPAEntityManagerSPIaddTransactionListener in interface OpenJPAEntityManageraddTransactionListener in interface OpenJPAEntityManagerSPIpublic void removeTransactionListener(Object listener)
OpenJPAEntityManagerSPIremoveTransactionListener in interface OpenJPAEntityManagerremoveTransactionListener in interface OpenJPAEntityManagerSPIpublic EnumSet<CallbackMode> getTransactionListenerCallbackModes()
OpenJPAEntityManagerSPICallbackMode flags for handling transaction listener
exceptions.getTransactionListenerCallbackModes in interface OpenJPAEntityManagerSPIpublic void setTransactionListenerCallbackMode(CallbackMode mode)
OpenJPAEntityManagerSPICallbackMode flag for handling transaction listener
exceptions. The flags provided here will entirely replace the
previous settings.setTransactionListenerCallbackMode in interface OpenJPAEntityManagerSPIpublic void setTransactionListenerCallbackMode(EnumSet<CallbackMode> modes)
OpenJPAEntityManagerSPICallbackMode flags for handling transaction listener
exceptions. The flags provided here will entirely replace the
previous settings.setTransactionListenerCallbackMode in interface OpenJPAEntityManagerSPIpublic int getTransactionListenerCallbackMode()
getTransactionListenerCallbackMode in interface OpenJPAEntityManagerpublic void setTransactionListenerCallbackMode(int callbackMode)
setTransactionListenerCallbackMode in interface OpenJPAEntityManagerpublic void addLifecycleListener(Object listener, Class... classes)
OpenJPAEntityManagerSPIaddLifecycleListener in interface OpenJPAEntityManageraddLifecycleListener in interface OpenJPAEntityManagerSPIpublic void removeLifecycleListener(Object listener)
OpenJPAEntityManagerSPIremoveLifecycleListener in interface OpenJPAEntityManagerremoveLifecycleListener in interface OpenJPAEntityManagerSPIpublic EnumSet<CallbackMode> getLifecycleListenerCallbackModes()
OpenJPAEntityManagerSPICallbackMode flags for handling lifecycle listener
exceptions.getLifecycleListenerCallbackModes in interface OpenJPAEntityManagerSPIpublic void setLifecycleListenerCallbackMode(CallbackMode mode)
OpenJPAEntityManagerSPICallbackMode flag for handling lifecycle listener
exceptions. The flags provided here will entirely replace the
previous settings.setLifecycleListenerCallbackMode in interface OpenJPAEntityManagerSPIpublic void setLifecycleListenerCallbackMode(EnumSet<CallbackMode> modes)
OpenJPAEntityManagerSPICallbackMode flags for handling lifecycle listener
exceptions. The flags provided here will entirely replace the
previous settings.setLifecycleListenerCallbackMode in interface OpenJPAEntityManagerSPIpublic int getLifecycleListenerCallbackMode()
getLifecycleListenerCallbackMode in interface OpenJPAEntityManagerpublic void setLifecycleListenerCallbackMode(int callbackMode)
setLifecycleListenerCallbackMode in interface OpenJPAEntityManagerpublic <T> T getReference(Class<T> cls, Object oid)
getReference in interface javax.persistence.EntityManagerpublic <T> T find(Class<T> cls, Object oid)
find in interface javax.persistence.EntityManagerpublic <T> T find(Class<T> cls, Object oid, javax.persistence.LockModeType mode)
find in interface javax.persistence.EntityManagerpublic <T> T find(Class<T> cls, Object oid, Map<String,Object> properties)
find in interface javax.persistence.EntityManagerpublic <T> T find(Class<T> cls, Object oid, javax.persistence.LockModeType mode, Map<String,Object> properties)
find in interface javax.persistence.EntityManagerpublic <T> T[] findAll(Class<T> cls, Object... oids)
OpenJPAEntityManagerfindAll in interface OpenJPAEntityManageroids - the oids of the objects to returnEntityManager.find(Class,Object)public <T> Collection<T> findAll(Class<T> cls, Collection oids)
OpenJPAEntityManagerfindAll in interface OpenJPAEntityManageroids - the oids of the objects to returnEntityManager.find(Class,Object)public <T> T findCached(Class<T> cls, Object oid)
OpenJPAEntityManagerfindCached in interface OpenJPAEntityManageroid - the object's idpublic Class getObjectIdClass(Class cls)
OpenJPAEntityManagergetObjectIdClass in interface OpenJPAEntityManagerpublic OpenJPAEntityTransaction getTransaction()
getTransaction in interface javax.persistence.EntityManagergetTransaction in interface OpenJPAEntityManagerpublic void joinTransaction()
joinTransaction in interface javax.persistence.EntityManagerpublic boolean isJoinedToTransaction()
isJoinedToTransaction in interface javax.persistence.EntityManagerpublic void begin()
begin in interface javax.persistence.EntityTransactionbegin in interface OpenJPAEntityManagerpublic void commit()
commit in interface javax.persistence.EntityTransactioncommit in interface OpenJPAEntityManagerpublic void rollback()
rollback in interface javax.persistence.EntityTransactionrollback in interface OpenJPAEntityManagerpublic void commitAndResume()
OpenJPAEntityTransactionmanager.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 OpenJPAEntityManagercommitAndResume in interface OpenJPAEntityTransactionEntityTransaction.commit(),
EntityTransaction.begin()public void rollbackAndResume()
OpenJPAEntityTransactionmanager.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 OpenJPAEntityManagerrollbackAndResume in interface OpenJPAEntityTransactionEntityTransaction.rollback(),
EntityTransaction.begin()public Throwable getRollbackCause()
OpenJPAEntityTransactiongetRollbackCause in interface OpenJPAEntityManagergetRollbackCause in interface OpenJPAEntityTransactionpublic boolean getRollbackOnly()
getRollbackOnly in interface javax.persistence.EntityTransactiongetRollbackOnly in interface OpenJPAEntityManagerpublic void setRollbackOnly()
setRollbackOnly in interface javax.persistence.EntityTransactionsetRollbackOnly in interface OpenJPAEntityManagerpublic void setRollbackOnly(Throwable cause)
OpenJPAEntityTransactionsetRollbackOnly in interface OpenJPAEntityManagersetRollbackOnly in interface OpenJPAEntityTransactionpublic void setSavepoint(String name)
OpenJPAEntityManagersetSavepoint in interface OpenJPAEntityManagerpublic void rollbackToSavepoint()
OpenJPAEntityManagerrollbackToSavepoint in interface OpenJPAEntityManagerpublic void rollbackToSavepoint(String name)
OpenJPAEntityManagerrollbackToSavepoint in interface OpenJPAEntityManagerpublic void releaseSavepoint()
OpenJPAEntityManagerreleaseSavepoint in interface OpenJPAEntityManagerpublic void releaseSavepoint(String name)
OpenJPAEntityManagerreleaseSavepoint in interface OpenJPAEntityManagerpublic void flush()
flush in interface javax.persistence.EntityManagerpublic void preFlush()
OpenJPAEntityManagerpreFlush in interface OpenJPAEntityManagerpublic void validateChanges()
OpenJPAEntityManagerEntityManager.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()
isActive in interface javax.persistence.EntityTransactionisActive in interface OpenJPAEntityManagerpublic boolean isStoreActive()
OpenJPAEntityManagerisStoreActive in interface OpenJPAEntityManagerpublic void beginStore()
OpenJPAEntityManagerbeginStore in interface OpenJPAEntityManagerpublic boolean contains(Object entity)
contains in interface javax.persistence.EntityManagerpublic boolean containsAll(Object... entities)
OpenJPAEntityManagercontainsAll in interface OpenJPAEntityManagerpublic boolean containsAll(Collection entities)
OpenJPAEntityManagercontainsAll in interface OpenJPAEntityManagerpublic void persist(Object entity)
persist in interface javax.persistence.EntityManagerpublic void persistAll(Object... entities)
OpenJPAEntityManagerpersistAll in interface OpenJPAEntityManagerpublic void persistAll(Collection entities)
OpenJPAEntityManagerpersistAll in interface OpenJPAEntityManagerpublic void remove(Object entity)
remove in interface javax.persistence.EntityManagerpublic void removeAll(Object... entities)
OpenJPAEntityManagerremoveAll in interface OpenJPAEntityManagerpublic void removeAll(Collection entities)
OpenJPAEntityManagerremoveAll in interface OpenJPAEntityManagerpublic void release(Object entity)
OpenJPAEntityManagerrelease in interface OpenJPAEntityManagerpublic void releaseAll(Collection entities)
OpenJPAEntityManagerreleaseAll in interface OpenJPAEntityManagerpublic void releaseAll(Object... entities)
OpenJPAEntityManagerreleaseAll in interface OpenJPAEntityManagerpublic void refresh(Object entity)
refresh in interface javax.persistence.EntityManagerpublic void refresh(Object entity, javax.persistence.LockModeType mode)
refresh in interface javax.persistence.EntityManagerpublic void refresh(Object entity, Map<String,Object> properties)
refresh in interface javax.persistence.EntityManagerpublic void refresh(Object entity, javax.persistence.LockModeType mode, Map<String,Object> properties)
refresh in interface javax.persistence.EntityManagerpublic void refreshAll()
OpenJPAEntityManagerrefreshAll in interface OpenJPAEntityManagerpublic void refreshAll(Collection entities)
OpenJPAEntityManagerrefreshAll in interface OpenJPAEntityManagerpublic void refreshAll(Object... entities)
OpenJPAEntityManagerrefreshAll in interface OpenJPAEntityManagerpublic void retrieve(Object entity)
OpenJPAEntityManagerretrieve in interface OpenJPAEntityManagerpublic void retrieveAll(Collection entities)
OpenJPAEntityManagerretrieveAll in interface OpenJPAEntityManagerOpenJPAEntityManager.retrieve(java.lang.Object)public void retrieveAll(Object... entities)
OpenJPAEntityManagerretrieveAll in interface OpenJPAEntityManagerOpenJPAEntityManager.retrieve(java.lang.Object)public void evict(Object entity)
OpenJPAEntityManagerEvict the given object.
Eviction acts as a hint to the persistence provider, and indicates that the persistent object is no longer needed by the application and may be garbage collected. It does not remove the object from the L1 cache and only affects objects which are managed and unmodified.
evict in interface OpenJPAEntityManagerentity - A persistent class which will be evictedpublic void evictAll(Collection entities)
OpenJPAEntityManagerEvict the given objects.
Eviction acts as a hint to the persistence provider, and indicates that the persistent object is no longer needed by the application and may be garbage collected. It does not remove the object from the L1 cache and only affects objects which are managed and unmodified.
evictAll in interface OpenJPAEntityManagerentities - A collection of persistent classes which will be evicted.public void evictAll(Object... entities)
OpenJPAEntityManagerEvict the given objects.
Eviction acts as a hint to the persistence provider, and indicates that the persistent object is no longer needed by the application and may be garbage collected. It does not remove the object from the L1 cache and only affects objects which are managed and unmodified.
evictAll in interface OpenJPAEntityManagerentities - The persistent classes which will be evictedpublic void evictAll()
OpenJPAEntityManagerEvict all clean objects.
Eviction acts as a hint to the persistence provider, and indicates that the persistent object is no longer needed by the application and may be garbage collected. It does not remove the object from the L1 cache and only affects objects which are managed and unmodified.
evictAll in interface OpenJPAEntityManagerpublic void evictAll(Class cls)
OpenJPAEntityManagerEvict all persistent-clean and persistent-nontransactional instances in the extent of the given class (including subclasses).
Eviction acts as a hint to the persistence provider, and indicates that the persistent object is no longer needed by the application and may be garbage collected. It does not remove the object from the L1 cache and only affects objects which are managed and unmodified.
evictAll in interface OpenJPAEntityManagercls - All clean instances of this class will be evicted.public void evictAll(Extent extent)
OpenJPAEntityManagerEvict all persistent-clean and persistent-nontransactional
instances in the given Extent.
Eviction acts as a hint to the persistence provider, and indicates that the persistent object is no longer needed by the application and may be garbage collected. It does not remove the object from the L1 cache and only affects objects which are managed and unmodified.
evictAll in interface OpenJPAEntityManagerextent - Extend which contains the persistent classes to evict.public <T> T detachCopy(T entity)
OpenJPAEntityManagerdetachCopy in interface OpenJPAEntityManagerentity - the instance to detachpublic Object[] detachAll(Object... entities)
OpenJPAEntityManagerdetachAll in interface OpenJPAEntityManagerentities - the instances to detachpublic Collection detachAll(Collection entities)
OpenJPAEntityManagerdetachAll in interface OpenJPAEntityManagerentities - the instances to detachpublic <T> T merge(T entity)
merge in interface javax.persistence.EntityManagerpublic Object[] mergeAll(Object... entities)
OpenJPAEntityManagermergeAll in interface OpenJPAEntityManagerentities - instances to importpublic Collection mergeAll(Collection entities)
OpenJPAEntityManagermergeAll in interface OpenJPAEntityManagerentities - Collection of instances to importpublic void transactional(Object entity, boolean updateVersion)
OpenJPAEntityManagertransactional in interface OpenJPAEntityManagerentity - instance to make transactionalupdateVersion - if true, the instance's version will be
incremented at the next flushpublic void transactionalAll(Collection objs, boolean updateVersion)
OpenJPAEntityManagertransactionalAll in interface OpenJPAEntityManagerobjs - instances to make transactionalupdateVersion - if true, the instance's version will be
incremented at the next flushpublic void transactionalAll(Object[] objs, boolean updateVersion)
OpenJPAEntityManagertransactionalAll in interface OpenJPAEntityManagerobjs - instances to make transactionalupdateVersion - if true, the instance's version will be
incremented at the next flushpublic void nontransactional(Object entity)
OpenJPAEntityManagernontransactional in interface OpenJPAEntityManagerpublic void nontransactionalAll(Collection objs)
OpenJPAEntityManagernontransactionalAll in interface OpenJPAEntityManagerpublic void nontransactionalAll(Object[] objs)
OpenJPAEntityManagernontransactionalAll in interface OpenJPAEntityManagerpublic Generator getNamedGenerator(String name)
OpenJPAEntityManagergetNamedGenerator 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 OpenJPAEntityManagerpublic 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 OpenJPAEntityManagerpublic <T> Extent<T> createExtent(Class<T> cls, boolean subclasses)
OpenJPAEntityManagercreateExtent in interface OpenJPAEntityManagerpublic <T> javax.persistence.TypedQuery<T> createQuery(String query, Class<T> resultClass)
createQuery in interface javax.persistence.EntityManagerpublic OpenJPAQuery createQuery(String query)
createQuery in interface javax.persistence.EntityManagercreateQuery in interface OpenJPAEntityManagerpublic OpenJPAQuery createQuery(String language, String query)
OpenJPAEntityManagercreateQuery in interface OpenJPAEntityManagerpublic OpenJPAQuery createQuery(javax.persistence.Query query)
OpenJPAEntityManagercreateQuery in interface OpenJPAEntityManagerpublic <T> javax.persistence.TypedQuery<T> createNamedQuery(String name, Class<T> resultClass)
createNamedQuery in interface javax.persistence.EntityManagerpublic OpenJPAQuery createNamedQuery(String name)
createNamedQuery in interface javax.persistence.EntityManagercreateNamedQuery in interface OpenJPAEntityManagerpublic OpenJPAQuery createNativeQuery(String query)
createNativeQuery in interface javax.persistence.EntityManagercreateNativeQuery in interface OpenJPAEntityManagerpublic OpenJPAQuery createNativeQuery(String query, Class cls)
createNativeQuery in interface javax.persistence.EntityManagercreateNativeQuery in interface OpenJPAEntityManagerpublic OpenJPAQuery createNativeQuery(String query, String mappingName)
createNativeQuery in interface javax.persistence.EntityManagercreateNativeQuery in interface OpenJPAEntityManagerpublic javax.persistence.StoredProcedureQuery createNamedStoredProcedureQuery(String name)
createNamedStoredProcedureQuery in interface javax.persistence.EntityManagerpublic javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName)
createStoredProcedureQuery in interface javax.persistence.EntityManagerpublic javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName, Class... resultClasses)
createStoredProcedureQuery in interface javax.persistence.EntityManagerpublic javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName, String... resultSetMappings)
createStoredProcedureQuery in interface javax.persistence.EntityManagerprotected <T> QueryImpl<T> newQueryImpl(Query kernelQuery, QueryMetaData qmd)
protected void validateSQL(String query)
public void setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode in interface javax.persistence.EntityManagerpublic javax.persistence.FlushModeType getFlushMode()
getFlushMode in interface javax.persistence.EntityManager@Deprecated public void prepareForPooling()
clear() instead.public void clear()
clear in interface javax.persistence.EntityManagerpublic Object getDelegate()
getDelegate in interface javax.persistence.EntityManagerpublic javax.persistence.LockModeType getLockMode(Object entity)
OpenJPAEntityManagergetLockMode in interface javax.persistence.EntityManagergetLockMode in interface OpenJPAEntityManagerpublic void lock(Object entity, javax.persistence.LockModeType mode)
lock in interface javax.persistence.EntityManagerpublic void lock(Object entity)
OpenJPAEntityManagerFetchPlan for the entity manager.lock in interface OpenJPAEntityManagerpublic void lock(Object entity, javax.persistence.LockModeType mode, int timeout)
OpenJPAEntityManagerlock 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 lock(Object entity, javax.persistence.LockModeType mode, Map<String,Object> properties)
lock in interface javax.persistence.EntityManagerpublic void lockAll(Collection entities)
OpenJPAEntityManagerFetchPlan for the entity manager.lockAll in interface OpenJPAEntityManagerpublic void lockAll(Collection entities, javax.persistence.LockModeType mode, int timeout)
OpenJPAEntityManagerlockAll 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 OpenJPAEntityManagerpublic void lockAll(Object[] entities, javax.persistence.LockModeType mode, int timeout)
OpenJPAEntityManagerlockAll 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()
OpenJPAEntityManagercancelAll in interface OpenJPAEntityManagerpublic Object getConnection()
OpenJPAEntityManagergetConnection in interface OpenJPAEntityManagerpublic Collection getManagedObjects()
OpenJPAEntityManagergetManagedObjects in interface OpenJPAEntityManagerpublic Collection getTransactionalObjects()
OpenJPAEntityManagergetTransactionalObjects in interface OpenJPAEntityManagerpublic Collection getPendingTransactionalObjects()
OpenJPAEntityManagergetPendingTransactionalObjects in interface OpenJPAEntityManagerpublic Collection getDirtyObjects()
OpenJPAEntityManagergetDirtyObjects in interface OpenJPAEntityManagerpublic boolean getOrderDirtyObjects()
OpenJPAEntityManagergetOrderDirtyObjects in interface OpenJPAEntityManagerpublic void setOrderDirtyObjects(boolean order)
OpenJPAEntityManagersetOrderDirtyObjects in interface OpenJPAEntityManagerpublic void dirtyClass(Class cls)
OpenJPAEntityManagerdirtyClass in interface OpenJPAEntityManagerpublic Collection<Class> getPersistedClasses()
OpenJPAEntityManagergetPersistedClasses in interface OpenJPAEntityManagerpublic Collection<Class> getUpdatedClasses()
OpenJPAEntityManagergetUpdatedClasses in interface OpenJPAEntityManagerpublic Collection<Class> getRemovedClasses()
OpenJPAEntityManagergetRemovedClasses 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, 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.createInstance in interface OpenJPAEntityManagerpublic void close()
public boolean isOpen()
isOpen in interface javax.persistence.EntityManagerpublic void dirty(Object o, String field)
OpenJPAEntityManagerdirty in interface OpenJPAEntityManagerpublic Object getObjectId(Object o)
OpenJPAEntityManagergetObjectId in interface OpenJPAEntityManagerpublic boolean isDirty(Object o)
OpenJPAEntityManagerisDirty in interface OpenJPAEntityManagerpublic boolean isTransactional(Object o)
OpenJPAEntityManagerisTransactional in interface OpenJPAEntityManagerpublic boolean isPersistent(Object o)
OpenJPAEntityManagerisPersistent in interface OpenJPAEntityManagerpublic boolean isNewlyPersistent(Object o)
OpenJPAEntityManagerisNewlyPersistent in interface OpenJPAEntityManagerpublic boolean isRemoved(Object o)
OpenJPAEntityManagerisRemoved 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(T)); otherwise returns
false.isDetached in interface OpenJPAEntityManagerpublic Object getVersion(Object o)
OpenJPAEntityManagero.getVersion in interface OpenJPAEntityManagerprotected void assertNotCloseInvoked()
public Object processArgument(Object arg)
FindCallbacksOpenJPAException for illegal value.processArgument in interface FindCallbackspublic Object processReturn(Object oid, OpenJPAStateManager sm)
FindCallbacksprocessReturn in interface FindCallbackspublic 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 nonepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void detach(Object entity)
detach in interface javax.persistence.EntityManagerpublic <T> javax.persistence.TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
createQuery in interface javax.persistence.EntityManagerpublic javax.persistence.Query createQuery(javax.persistence.criteria.CriteriaUpdate updateQuery)
createQuery in interface javax.persistence.EntityManagerpublic javax.persistence.Query createQuery(javax.persistence.criteria.CriteriaDelete deleteQuery)
createQuery in interface javax.persistence.EntityManagerpublic OpenJPAQuery createDynamicQuery(QueryDefinition qdef)
OpenJPAEntityManagercreateDynamicQuery in interface OpenJPAEntityManagerpublic Map<String,Object> getProperties()
getProperties in interface javax.persistence.EntityManagerpublic OpenJPACriteriaBuilder getCriteriaBuilder()
OpenJPAEntityManagergetCriteriaBuilder in interface javax.persistence.EntityManagergetCriteriaBuilder in interface OpenJPAEntityManagerpublic Set<String> getSupportedProperties()
OpenJPAEntityManagergetSupportedProperties in interface OpenJPAEntityManagerpublic <T> T unwrap(Class<T> cls)
unwrap in interface javax.persistence.EntityManagerif - the given class is null, generic Object.class or a class
that is not wrapped by this receiver.public void setQuerySQLCache(boolean flag)
OpenJPAEntityManagerSPIsetQuerySQLCache in interface OpenJPAEntityManagerSPIpublic boolean getQuerySQLCache()
OpenJPAEntityManagerSPIgetQuerySQLCache in interface OpenJPAEntityManagerSPIpublic javax.persistence.metamodel.Metamodel getMetamodel()
getMetamodel in interface javax.persistence.EntityManagerpublic <T> javax.persistence.EntityGraph<T> createEntityGraph(Class<T> rootType)
createEntityGraph in interface javax.persistence.EntityManagerpublic javax.persistence.EntityGraph<?> createEntityGraph(String graphName)
createEntityGraph in interface javax.persistence.EntityManagerpublic javax.persistence.EntityGraph<?> getEntityGraph(String graphName)
getEntityGraph in interface javax.persistence.EntityManagerpublic <T> List<javax.persistence.EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass)
getEntityGraphs in interface javax.persistence.EntityManagerpublic void setProperty(String prop, Object value)
setProperty in interface javax.persistence.EntityManagerCopyright © 2006–2022 Apache Software Foundation. All rights reserved.