Java javax.persistence EntityManager fields, constructors, methods, implement or subclass

Example usage for Java javax.persistence EntityManager fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.persistence EntityManager.

The text is from its open source code.

Implementation

javax.persistence.EntityManager has the following implementations.
Click this link to see all its implementation.

Method

voidclear()
Clear the persistence context, causing all managed entities to become detached.
voidclose()
Close an application-managed entity manager.
booleancontains(Object entity)
Check if the instance is a managed entity instance belonging to the current persistence context.
QuerycreateNamedQuery(String name)
Create an instance of Query for executing a named query (in the Java Persistence query language or in native SQL).
TypedQuerycreateNamedQuery(String name, Class resultClass)
Create an instance of TypedQuery for executing a Java Persistence query language named query.
QuerycreateNativeQuery(String sqlString, Class resultClass)
Create an instance of Query for executing a native SQL query.
QuerycreateNativeQuery(String sqlString, String resultSetMapping)
Create an instance of Query for executing a native SQL query.
QuerycreateNativeQuery(String sqlString)
Create an instance of Query for executing a native SQL statement, e.g., for update or delete.
TypedQuerycreateQuery(String qlString, Class resultClass)
Create an instance of TypedQuery for executing a Java Persistence query language statement.
QuerycreateQuery(String qlString)
Create an instance of Query for executing a Java Persistence query language statement.
TypedQuerycreateQuery(CriteriaQuery criteriaQuery)
Create an instance of TypedQuery for executing a criteria query.
QuerycreateQuery(CriteriaUpdate updateQuery)
Create an instance of Query for executing a criteria update query.
QuerycreateQuery(CriteriaDelete deleteQuery)
Create an instance of Query for executing a criteria delete query.
voiddetach(Object entity)
Remove the given entity from the persistence context, causing a managed entity to become detached.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
Tfind(Class entityClass, Object primaryKey)
Find by primary key.
Tfind(Class entityClass, Object primaryKey, Map properties)
Find by primary key, using the specified properties.
Tfind(Class entityClass, Object primaryKey, LockModeType lockMode)
Find by primary key and lock.
voidflush()
Synchronize the persistence context to the underlying database.
ClassgetClass()
Returns the runtime class of this Object .
CriteriaBuildergetCriteriaBuilder()
Return an instance of CriteriaBuilder for the creation of CriteriaQuery objects.
ObjectgetDelegate()
Return the underlying provider object for the EntityManager, if available.
EntityManagerFactorygetEntityManagerFactory()
Return the entity manager factory for the entity manager.
MetamodelgetMetamodel()
Return an instance of Metamodel interface for access to the metamodel of the persistence unit.
TgetReference(Class entityClass, Object primaryKey)
Get an instance, whose state may be lazily fetched.
EntityTransactiongetTransaction()
Return the resource-level EntityTransaction object.
inthashCode()
Returns a hash code value for the object.
booleanisJoinedToTransaction()
Determine whether the entity manager is joined to the current transaction.
booleanisOpen()
Determine whether the entity manager is open.
voidjoinTransaction()
Indicate to the entity manager that a JTA transaction is active and join the persistence context to it.
voidlock(Object entity, LockModeType lockMode)
Lock an entity instance that is contained in the persistence context with the specified lock mode type.
Tmerge(T entity)
Merge the state of the given entity into the current persistence context.
voidpersist(Object entity)
Make an instance managed and persistent.
voidrefresh(Object entity)
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.
voidrefresh(Object entity, Map properties)
Refresh the state of the instance from the database, using the specified properties, and overwriting changes made to the entity, if any.
voidrefresh(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.
voidremove(Object entity)
Remove the entity instance.
voidsetFlushMode(FlushModeType flushMode)
Set the flush mode that applies to all objects contained in the persistence context.
voidsetProperty(String propertyName, Object value)
Set an entity manager property or hint.
StringtoString()
Returns a string representation of the object.
Tunwrap(Class cls)
Return an object of the specified type to allow access to the provider-specific API.