Example usage for Java javax.persistence EntityManager fields, constructors, methods, implement or subclass
The text is from its open source code.
void | clear() Clear the persistence context, causing all managed entities to become detached. |
void | close() Close an application-managed entity manager. |
boolean | contains(Object entity) Check if the instance is a managed entity instance belonging to the current persistence context. |
Query | createNamedQuery(String name) Create an instance of Query for executing a named query (in the Java Persistence query language or in native SQL). |
TypedQuery | createNamedQuery(String name, Class Create an instance of TypedQuery for executing a Java Persistence query language named query. |
Query | createNativeQuery(String sqlString, Class resultClass) Create an instance of Query for executing a native SQL query. |
Query | createNativeQuery(String sqlString, String resultSetMapping) Create an instance of Query for executing a native SQL query. |
Query | createNativeQuery(String sqlString) Create an instance of Query for executing a native SQL statement, e.g., for update or delete. |
TypedQuery | createQuery(String qlString, Class Create an instance of TypedQuery for executing a Java Persistence query language statement. |
Query | createQuery(String qlString) Create an instance of Query for executing a Java Persistence query language statement. |
TypedQuery | createQuery(CriteriaQuery Create an instance of TypedQuery for executing a criteria query. |
Query | createQuery(CriteriaUpdate updateQuery) Create an instance of Query for executing a criteria update query. |
Query | createQuery(CriteriaDelete deleteQuery) Create an instance of Query for executing a criteria delete query. |
void | detach(Object entity) Remove the given entity from the persistence context, causing a managed entity to become detached. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
T | find(Class Find by primary key. |
T | find(Class Find by primary key, using the specified properties. |
T | find(Class Find by primary key and lock. |
void | flush() Synchronize the persistence context to the underlying database. |
Class> | getClass() Returns the runtime class of this Object . |
CriteriaBuilder | getCriteriaBuilder() Return an instance of CriteriaBuilder for the creation of CriteriaQuery objects. |
Object | getDelegate() Return the underlying provider object for the EntityManager , if available. |
EntityManagerFactory | getEntityManagerFactory() Return the entity manager factory for the entity manager. |
Metamodel | getMetamodel() Return an instance of Metamodel interface for access to the metamodel of the persistence unit. |
T | getReference(Class Get an instance, whose state may be lazily fetched. |
EntityTransaction | getTransaction() Return the resource-level EntityTransaction object. |
int | hashCode() Returns a hash code value for the object. |
boolean | isJoinedToTransaction() Determine whether the entity manager is joined to the current transaction. |
boolean | isOpen() Determine whether the entity manager is open. |
void | joinTransaction() Indicate to the entity manager that a JTA transaction is active and join the persistence context to it. |
void | lock(Object entity, LockModeType lockMode) Lock an entity instance that is contained in the persistence context with the specified lock mode type. |
T | merge(T entity) Merge the state of the given entity into the current persistence context. |
void | persist(Object entity) Make an instance managed and persistent. |
void | refresh(Object entity) Refresh the state of the instance from the database, overwriting changes made to the entity, if any. |
void | refresh(Object entity, Map Refresh the state of the instance from the database, using the specified properties, and overwriting changes made to the entity, if any. |
void | refresh(Object entity, LockModeType lockMode) Refresh the state of the instance from the database, overwriting changes made to the entity, if any, and lock it with respect to given lock mode type. |
void | remove(Object entity) Remove the entity instance. |
void | setFlushMode(FlushModeType flushMode) Set the flush mode that applies to all objects contained in the persistence context. |
void | setProperty(String propertyName, Object value) Set an entity manager property or hint. |
String | toString() Returns a string representation of the object. |
T | unwrap(Class Return an object of the specified type to allow access to the provider-specific API. |