public abstract class AbstractEntityManagerAdapter extends Object implements EntityManagerAdapter
| Constructor and Description |
|---|
AbstractEntityManagerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
close() |
boolean |
contains(Object entity) |
<T> javax.persistence.EntityGraph<T> |
createEntityGraph(Class<T> rootType) |
javax.persistence.EntityGraph<?> |
createEntityGraph(String graphName) |
javax.persistence.Query |
createNamedQuery(String name)
Create an instance of
Query for executing a named query
(in the Java Persistence query language or in native SQL). |
<T> javax.persistence.TypedQuery<T> |
createNamedQuery(String name,
Class<T> resultClass)
Create an instance of
TypedQuery for executing a
Java Persistence query language named query. |
javax.persistence.StoredProcedureQuery |
createNamedStoredProcedureQuery(String name) |
javax.persistence.Query |
createNativeQuery(String sql) |
javax.persistence.Query |
createNativeQuery(String sqlString,
Class resultClass) |
javax.persistence.Query |
createNativeQuery(String sqlString,
String resultSetMapping) |
javax.persistence.Query |
createQuery(javax.persistence.criteria.CriteriaDelete deleteQuery)
Create an instance of Query for executing a criteria
delete query.
|
<T> javax.persistence.TypedQuery<T> |
createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
Create an instance of
TypedQuery for executing a
criteria query. |
javax.persistence.Query |
createQuery(javax.persistence.criteria.CriteriaUpdate updateQuery)
Create an instance of Query for executing a criteria
update query.
|
javax.persistence.Query |
createQuery(String qlString)
Create an instance of
Query for executing a
Java Persistence query language statement. |
<T> javax.persistence.TypedQuery<T> |
createQuery(String qlString,
Class<T> resultClass)
Create an instance of
TypedQuery for executing a
Java Persistence query language statement. |
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) |
<T> T |
find(Class<T> entityClass,
Object primaryKey)
Find by primary key.
|
<T> T |
find(Class<T> entityClass,
Object primaryKey,
javax.persistence.LockModeType lockMode)
Find by primary key and lock.
|
<T> T |
find(Class<T> entityClass,
Object primaryKey,
javax.persistence.LockModeType lockMode,
Map<String,Object> properties)
Find by primary key and lock, using the specified properties.
|
<T> T |
find(Class<T> entityClass,
Object primaryKey,
Map<String,Object> properties)
Find by primary key, using the specified properties.
|
void |
flush() |
javax.persistence.criteria.CriteriaBuilder |
getCriteriaBuilder()
Return an instance of
CriteriaBuilder for the creation of
CriteriaQuery objects. |
Object |
getDelegate() |
javax.persistence.EntityGraph<?> |
getEntityGraph(String graphName) |
<T> List<javax.persistence.EntityGraph<? super T>> |
getEntityGraphs(Class<T> entityClass) |
protected Class<?> |
getEntityIdType(Class<?> entity) |
protected Class<?> |
getEntityIdType(javax.persistence.metamodel.EntityType<?> entity) |
javax.persistence.EntityManagerFactory |
getEntityManagerFactory() |
protected javax.persistence.metamodel.EntityType<?> |
getEntityMetaModel(Class<?> entityType) |
javax.persistence.FlushModeType |
getFlushMode() |
protected String |
getIdFieldName(Class<?> entityType) |
javax.persistence.LockModeType |
getLockMode(Object entity) |
javax.persistence.metamodel.Metamodel |
getMetamodel()
Return an instance of
Metamodel interface for access to the
metamodel of the persistence unit. |
Map<String,Object> |
getProperties() |
<T> T |
getReference(Class<T> entityClass,
Object primaryKey) |
javax.persistence.EntityTransaction |
getTransaction() |
boolean |
isJoinedToTransaction() |
boolean |
isOpen() |
void |
joinTransaction() |
void |
lock(Object entity,
javax.persistence.LockModeType lockMode) |
void |
lock(Object entity,
javax.persistence.LockModeType lockMode,
Map<String,Object> properties) |
<T> T |
merge(T entity) |
void |
persist(Object entity) |
void |
refresh(Object entity) |
void |
refresh(Object entity,
javax.persistence.LockModeType lockMode) |
void |
refresh(Object entity,
javax.persistence.LockModeType lockMode,
Map<String,Object> properties) |
void |
refresh(Object entity,
Map<String,Object> properties) |
void |
remove(Object entity) |
void |
setFlushMode(javax.persistence.FlushModeType flushMode) |
void |
setProperty(String propertyName,
Object value) |
<T> T |
unwrap(Class<T> cls) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEntityManageremptyMap, listOf, mapOf, mapPartitions, mapPartitions, partitions, partitionsStream, partitionsTo, range, range, rawRange, rawRangepublic javax.persistence.Query createNativeQuery(String sql)
createNativeQuery in interface EntityManagerAdaptercreateNativeQuery in interface javax.persistence.EntityManagerpublic javax.persistence.Query createNativeQuery(String sqlString, Class resultClass)
createNativeQuery in interface EntityManagerAdaptercreateNativeQuery in interface javax.persistence.EntityManagerpublic javax.persistence.Query createNativeQuery(String sqlString, String resultSetMapping)
createNativeQuery in interface EntityManagerAdaptercreateNativeQuery in interface javax.persistence.EntityManagerpublic javax.persistence.Query createQuery(String qlString)
Query for executing a
Java Persistence query language statement.createQuery in interface EntityManagerAdaptercreateQuery in interface javax.persistence.EntityManagerqlString - a Java Persistence query stringIllegalArgumentException - if the query string is
found to be invalidpublic <T> javax.persistence.TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
TypedQuery for executing a
criteria query.createQuery in interface EntityManagerAdaptercreateQuery in interface javax.persistence.EntityManagercriteriaQuery - a criteria query objectIllegalArgumentException - if the criteria query is
found to be invalidpublic javax.persistence.Query createQuery(javax.persistence.criteria.CriteriaUpdate updateQuery)
createQuery in interface EntityManagerAdaptercreateQuery in interface javax.persistence.EntityManagerupdateQuery - a criteria update query objectIllegalArgumentException - if the update query is found to be invalidpublic javax.persistence.Query createQuery(javax.persistence.criteria.CriteriaDelete deleteQuery)
createQuery in interface EntityManagerAdaptercreateQuery in interface javax.persistence.EntityManagerdeleteQuery - a criteria delete query objectIllegalArgumentException - if the delete query isfound to be invalidpublic <T> javax.persistence.TypedQuery<T> createQuery(String qlString, Class<T> resultClass)
TypedQuery for executing a
Java Persistence query language statement.
The select list of the query must contain only a single
item, which must be assignable to the type specified by
the resultClass argument.createQuery in interface EntityManagerAdaptercreateQuery in interface javax.persistence.EntityManagerqlString - a Java Persistence query stringresultClass - the type of the query resultIllegalArgumentException - if the query string is found
to be invalid or if the query result is found to
not be assignable to the specified typepublic javax.persistence.Query createNamedQuery(String name)
Query for executing a named query
(in the Java Persistence query language or in native SQL).createNamedQuery in interface EntityManagerAdaptercreateNamedQuery in interface javax.persistence.EntityManagername - the name of a query defined in metadataIllegalArgumentException - if a query has not been
defined with the given name or if the query string is
found to be invalidpublic <T> javax.persistence.TypedQuery<T> createNamedQuery(String name, Class<T> resultClass)
TypedQuery for executing a
Java Persistence query language named query.
The select list of the query must contain only a single
item, which must be assignable to the type specified by
the resultClass argument.createNamedQuery in interface EntityManagerAdaptercreateNamedQuery in interface javax.persistence.EntityManagername - the name of a query defined in metadataresultClass - the type of the query resultIllegalArgumentException - if a query has not been
defined with the given name or if the query string is
found to be invalid or if the query result is found to
not be assignable to the specified typepublic javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
CriteriaBuilder for the creation of
CriteriaQuery objects.getCriteriaBuilder in interface EntityManagerAdaptergetCriteriaBuilder in interface javax.persistence.EntityManagerIllegalStateException - if the entity manager has
been closedpublic <T> T find(Class<T> entityClass, Object primaryKey)
find in interface EntityManagerAdapterfind in interface javax.persistence.EntityManagerentityClass - entity classprimaryKey - primary keyIllegalArgumentException - if the first argument does
not denote an entity type or the second argument is
is not a valid type for that entity's primary key or
is nullpublic <T> T find(Class<T> entityClass, Object primaryKey, Map<String,Object> properties)
find in interface EntityManagerAdapterfind in interface javax.persistence.EntityManagerentityClass - entity classprimaryKey - primary keyproperties - standard and vendor-specific properties
and hintsIllegalArgumentException - if the first argument does
not denote an entity type or the second argument is
is not a valid type for that entity's primary key or
is nullpublic <T> T find(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockMode)
If the entity is found within the persistence context and the
lock mode type is pessimistic and the entity has a version
attribute, the persistence provider must perform optimistic
version checks when obtaining the database lock. If these
checks fail, the OptimisticLockException will be thrown.
If the lock mode type is pessimistic and the entity instance is found but cannot be locked:
PessimisticLockException will be thrown if the database
locking failure causes transaction-level rollback
LockTimeoutException will be thrown if the database
locking failure causes only statement-level rollback
find in interface EntityManagerAdapterfind in interface javax.persistence.EntityManagerentityClass - entity classprimaryKey - primary keylockMode - lock modeIllegalArgumentException - if the first argument does
not denote an entity type or the second argument is
not a valid type for that entity's primary key or
is nulljavax.persistence.TransactionRequiredException - if there is no
transaction and a lock mode other than NONE is
specified or if invoked on an entity manager which has
not been joined to the current transaction and a lock
mode other than NONE is specifiedjavax.persistence.OptimisticLockException - if the optimistic version
check failsjavax.persistence.PessimisticLockException - if pessimistic locking
fails and the transaction is rolled backjavax.persistence.LockTimeoutException - if pessimistic locking fails and
only the statement is rolled backjavax.persistence.PersistenceException - if an unsupported lock call
is madepublic <T> T find(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
If the entity is found
within the persistence context and the lock mode type
is pessimistic and the entity has a version attribute, the
persistence provider must perform optimistic version checks
when obtaining the database lock. If these checks fail,
the OptimisticLockException will be thrown.
If the lock mode type is pessimistic and the entity instance is found but cannot be locked:
PessimisticLockException will be thrown if the database
locking failure causes transaction-level rollback
LockTimeoutException will be thrown if the database
locking failure causes only statement-level rollback
If a vendor-specific property or hint is not recognized, it is silently ignored.
Portable applications should not rely on the standard timeout hint. Depending on the database in use and the locking mechanisms used by the provider, the hint may or may not be observed.
find in interface EntityManagerAdapterfind in interface javax.persistence.EntityManagerentityClass - entity classprimaryKey - primary keylockMode - lock modeproperties - standard and vendor-specific properties
and hintsIllegalArgumentException - if the first argument does
not denote an entity type or the second argument is
not a valid type for that entity's primary key or
is nulljavax.persistence.TransactionRequiredException - if there is no
transaction and a lock mode other than NONE is
specified or if invoked on an entity manager which has
not been joined to the current transaction and a lock
mode other than NONE is specifiedjavax.persistence.OptimisticLockException - if the optimistic version
check failsjavax.persistence.PessimisticLockException - if pessimistic locking
fails and the transaction is rolled backjavax.persistence.LockTimeoutException - if pessimistic locking fails and
only the statement is rolled backjavax.persistence.PersistenceException - if an unsupported lock call
is madepublic <T> T merge(T entity)
merge in interface EntityManagerAdaptermerge in interface javax.persistence.EntityManagerpublic void remove(Object entity)
remove in interface EntityManagerAdapterremove in interface javax.persistence.EntityManagerpublic javax.persistence.metamodel.Metamodel getMetamodel()
Metamodel interface for access to the
metamodel of the persistence unit.getMetamodel in interface EntityManagerAdaptergetMetamodel in interface javax.persistence.EntityManagerIllegalStateException - if the entity manager has
been closedpublic void persist(Object entity)
persist in interface EntityManagerAdapterpersist in interface javax.persistence.EntityManagerpublic <T> T getReference(Class<T> entityClass, Object primaryKey)
getReference in interface EntityManagerAdaptergetReference in interface javax.persistence.EntityManagerpublic void flush()
flush in interface EntityManagerAdapterflush in interface javax.persistence.EntityManagerpublic javax.persistence.FlushModeType getFlushMode()
getFlushMode in interface EntityManagerAdaptergetFlushMode in interface javax.persistence.EntityManagerpublic void setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode in interface EntityManagerAdaptersetFlushMode in interface javax.persistence.EntityManagerpublic void lock(Object entity, javax.persistence.LockModeType lockMode)
lock in interface EntityManagerAdapterlock in interface javax.persistence.EntityManagerpublic void lock(Object entity, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
lock in interface EntityManagerAdapterlock in interface javax.persistence.EntityManagerpublic void refresh(Object entity)
refresh in interface EntityManagerAdapterrefresh in interface javax.persistence.EntityManagerpublic void refresh(Object entity, Map<String,Object> properties)
refresh in interface EntityManagerAdapterrefresh in interface javax.persistence.EntityManagerpublic void refresh(Object entity, javax.persistence.LockModeType lockMode)
refresh in interface EntityManagerAdapterrefresh in interface javax.persistence.EntityManagerpublic void refresh(Object entity, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
refresh in interface EntityManagerAdapterrefresh in interface javax.persistence.EntityManagerpublic void clear()
clear in interface EntityManagerAdapterclear in interface javax.persistence.EntityManagerpublic void detach(Object entity)
detach in interface EntityManagerAdapterdetach in interface javax.persistence.EntityManagerpublic boolean contains(Object entity)
contains in interface EntityManagerAdaptercontains in interface javax.persistence.EntityManagerpublic javax.persistence.LockModeType getLockMode(Object entity)
getLockMode in interface EntityManagerAdaptergetLockMode in interface javax.persistence.EntityManagerpublic void setProperty(String propertyName, Object value)
setProperty in interface EntityManagerAdaptersetProperty in interface javax.persistence.EntityManagerpublic Map<String,Object> getProperties()
getProperties in interface EntityManagerAdaptergetProperties in interface javax.persistence.EntityManagerpublic javax.persistence.StoredProcedureQuery createNamedStoredProcedureQuery(String name)
createNamedStoredProcedureQuery in interface EntityManagerAdaptercreateNamedStoredProcedureQuery in interface javax.persistence.EntityManagerpublic javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName)
createStoredProcedureQuery in interface EntityManagerAdaptercreateStoredProcedureQuery in interface javax.persistence.EntityManagerpublic javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName, Class... resultClasses)
createStoredProcedureQuery in interface EntityManagerAdaptercreateStoredProcedureQuery in interface javax.persistence.EntityManagerpublic javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName, String... resultSetMappings)
createStoredProcedureQuery in interface EntityManagerAdaptercreateStoredProcedureQuery in interface javax.persistence.EntityManagerpublic void joinTransaction()
joinTransaction in interface EntityManagerAdapterjoinTransaction in interface javax.persistence.EntityManagerpublic boolean isJoinedToTransaction()
isJoinedToTransaction in interface EntityManagerAdapterisJoinedToTransaction in interface javax.persistence.EntityManagerpublic <T> T unwrap(Class<T> cls)
unwrap in interface EntityManagerAdapterunwrap in interface javax.persistence.EntityManagerpublic Object getDelegate()
getDelegate in interface EntityManagerAdaptergetDelegate in interface javax.persistence.EntityManagerpublic void close()
close in interface EntityManagerAdapterclose in interface javax.persistence.EntityManagerpublic boolean isOpen()
isOpen in interface EntityManagerAdapterisOpen in interface javax.persistence.EntityManagerpublic javax.persistence.EntityTransaction getTransaction()
getTransaction in interface EntityManagerAdaptergetTransaction in interface javax.persistence.EntityManagerpublic javax.persistence.EntityManagerFactory getEntityManagerFactory()
getEntityManagerFactory in interface EntityManagerAdaptergetEntityManagerFactory in interface javax.persistence.EntityManagerpublic <T> javax.persistence.EntityGraph<T> createEntityGraph(Class<T> rootType)
createEntityGraph in interface EntityManagerAdaptercreateEntityGraph in interface javax.persistence.EntityManagerpublic javax.persistence.EntityGraph<?> createEntityGraph(String graphName)
createEntityGraph in interface EntityManagerAdaptercreateEntityGraph in interface javax.persistence.EntityManagerpublic javax.persistence.EntityGraph<?> getEntityGraph(String graphName)
getEntityGraph in interface EntityManagerAdaptergetEntityGraph in interface javax.persistence.EntityManagerpublic <T> List<javax.persistence.EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass)
getEntityGraphs in interface EntityManagerAdaptergetEntityGraphs in interface javax.persistence.EntityManagerprotected Class<?> getEntityIdType(javax.persistence.metamodel.EntityType<?> entity)
protected javax.persistence.metamodel.EntityType<?> getEntityMetaModel(Class<?> entityType)
Copyright © 2018. All rights reserved.