Errai 3.0.1-SNAPSHOT

org.jboss.errai.jpa.client.local
Class ErraiEntityManager

java.lang.Object
  extended by org.jboss.errai.jpa.client.local.ErraiEntityManager
All Implemented Interfaces:
javax.persistence.EntityManager

public class ErraiEntityManager
extends Object
implements javax.persistence.EntityManager

The Errai implementation and specialization of the JPA 2.0 EntityManager interface.

Author:
Jonathan Fuerth

Constructor Summary
ErraiEntityManager(ErraiEntityManager delegateEntityManager, StorageBackendFactory namespacedStorageBackend)
          Creates an EntityManager that knows about all the same managed types and named queries as the given entity manager, but works from a different storage backend.
ErraiEntityManager(ErraiMetamodel metamodel, Map<String,TypedQueryFactory> namedQueries, StorageBackendFactory storageBackendFactory)
          Constructor for building custom-purpose EntityManager instances.
 
Method Summary
 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.
 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.Query createNativeQuery(String sqlString)
          Create an instance of Query for executing a native SQL statement, e.g., for update or delete.
 javax.persistence.Query createNativeQuery(String sqlString, Class resultClass)
          Create an instance of Query for executing a native SQL query.
 javax.persistence.Query createNativeQuery(String sqlString, String resultSetMapping)
          Create an instance of Query for executing a native SQL 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(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.
 void detach(Object entity)
          Remove the given entity from the persistence context, causing a managed entity to become detached.
<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.
<X> X
find(Class<X> entityClass, Object primaryKey)
          Find by primary key.
<X> X
find(Class<X> entityClass, Object primaryKey, Map<String,Object> properties)
          Find by primary key, using the specified properties.
<X> X
find(Key<X,?> key, Map<String,Object> properties)
          Retrieves the entity instance identified by the given Key.
<X> List<X>
findAll(ErraiIdentifiableType<X> type, EntityJsonMatcher matcher)
          EXPERIMENTAL.
 void flush()
          Synchronize the persistence context to the underlying database.
 javax.persistence.criteria.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.
 javax.persistence.EntityManagerFactory getEntityManagerFactory()
          Return the entity manager factory for the entity manager.
 javax.persistence.FlushModeType getFlushMode()
          Get the flush mode that applies to all objects contained in the persistence context.
 javax.persistence.LockModeType getLockMode(Object entity)
          Get the current lock mode for the entity instance.
 ErraiMetamodel getMetamodel()
          Return an instance of Metamodel interface for access to the metamodel of the persistence unit.
 Map<String,Object> getProperties()
          Get the properties and hints and associated values that are in effect for the entity manager.
<T> T
getReference(Class<T> entityClass, Object primaryKey)
          Get an instance, whose state may be lazily fetched.
 javax.persistence.EntityTransaction getTransaction()
          Return the resource-level EntityTransaction object.
 boolean isKeyInUse(Key<?,?> key)
          Tests if this entity manager's storage backend contains an entity that could conflict with the given key.
 boolean isOpen()
          Determine whether the entity manager is open.
 void joinTransaction()
          Indicate to the entity manager that a JTA transaction is active.
<X> Key<X,?>
keyFor(ErraiIdentifiableType<X> entityType, X entity)
          Creates the key that describes the given entity, generating and setting it if it is presently unset and the given entity type's ID is configured to be generated on demand.
<X> Key<X,?>
keyFor(X entity)
          Creates the key that describes the given entity, generating and setting it if it is presently unset and the given entity type's ID is configured to be generated on demand.
 void lock(Object entity, javax.persistence.LockModeType lockMode)
          Lock an entity instance that is contained in the persistence context with the specified lock mode type.
 void lock(Object entity, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
          Lock an entity instance that is contained in the persistence context with the specified lock mode type and with specified properties.
<T> 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, javax.persistence.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 refresh(Object entity, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
          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 and with specified properties.
 void refresh(Object entity, Map<String,Object> properties)
          Refresh the state of the instance from the database, using the specified properties, and overwriting changes made to the entity, if any.
 void remove(Object entity)
          Remove the entity instance.
 void removeAll()
          Removes everything from the backend data store and clears the persistence context.
 void setFlushMode(javax.persistence.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.
<T> T
unwrap(Class<T> cls)
          Return an object of the specified type to allow access to the provider-specific API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErraiEntityManager

public ErraiEntityManager(ErraiMetamodel metamodel,
                          Map<String,TypedQueryFactory> namedQueries,
                          StorageBackendFactory storageBackendFactory)
Constructor for building custom-purpose EntityManager instances. For common usecases, simply use @Inject EntityManager em and let the ErraiEntityManagerProvider handle the prerequisites for you.


ErraiEntityManager

public ErraiEntityManager(ErraiEntityManager delegateEntityManager,
                          StorageBackendFactory namespacedStorageBackend)
Creates an EntityManager that knows about all the same managed types and named queries as the given entity manager, but works from a different storage backend. When combined with the namespacing support of a storage backend, this allows you to work with several independent entity managers at the same time.

Parameters:
delegateEntityManager -
namespacedStorageBackend -
Method Detail

keyFor

public <X> Key<X,?> keyFor(X entity)
Creates the key that describes the given entity, generating and setting it if it is presently unset and the given entity type's ID is configured to be generated on demand. This version of the keyFor() method assumes the given object's entity type can be obtained by calling entity.getClass(). If you already have a specific entity type in mind, use the keyFor(ErraiIdentifiableType, Object) version of the method.

Parameters:
entityType - The entity type of the entity
entity - The entity instance. Side effect: this instance may have its ID value initialized as a result of this call.
Returns:
The key for the given entity, which--for generated values--may have just been set on the entity.

keyFor

public <X> Key<X,?> keyFor(ErraiIdentifiableType<X> entityType,
                           X entity)
Creates the key that describes the given entity, generating and setting it if it is presently unset and the given entity type's ID is configured to be generated on demand.

Parameters:
entityType - The entity type of the entity
entity - The entity instance. Side effect: this instance may have its ID value initialized as a result of this call.
Returns:
The key for the given entity, which--for generated values--may have just been set on the entity.

findAll

public <X> List<X> findAll(ErraiIdentifiableType<X> type,
                           EntityJsonMatcher matcher)
EXPERIMENTAL. This method is very unlikely to survive in the long run.


isKeyInUse

public boolean isKeyInUse(Key<?,?> key)
Tests if this entity manager's storage backend contains an entity that could conflict with the given key. This method is free of side effects: it will not affect the contents of the persistence context, and it will not affect the persistence state of any entity (hence it will not deliver any events to JPA lifecycle listeners).

Parameters:
key - The key to test for in backend storage. Not null.
Returns:
true if and only if this entity manager's storage backend contains an entity with the given key.

getMetamodel

public ErraiMetamodel getMetamodel()
Description copied from interface: javax.persistence.EntityManager
Return an instance of Metamodel interface for access to the metamodel of the persistence unit.

Specified by:
getMetamodel in interface javax.persistence.EntityManager
Returns:
Metamodel instance

persist

public void persist(Object entity)
Description copied from interface: javax.persistence.EntityManager
Make an instance managed and persistent.

Specified by:
persist in interface javax.persistence.EntityManager
Parameters:
entity - entity instance

flush

public void flush()
Description copied from interface: javax.persistence.EntityManager
Synchronize the persistence context to the underlying database.

Specified by:
flush in interface javax.persistence.EntityManager

detach

public void detach(Object entity)
Description copied from interface: javax.persistence.EntityManager
Remove the given entity from the persistence context, causing a managed entity to become detached. Unflushed changes made to the entity if any (including removal of the entity), will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it.

Specified by:
detach in interface javax.persistence.EntityManager
Parameters:
entity - entity instance

clear

public void clear()
Description copied from interface: javax.persistence.EntityManager
Clear the persistence context, causing all managed entities to become detached. Changes made to entities that have not been flushed to the database will not be persisted.

Specified by:
clear in interface javax.persistence.EntityManager

find

public <X> X find(Class<X> entityClass,
                  Object primaryKey)
Description copied from interface: javax.persistence.EntityManager
Find by primary key. Search for an entity of the specified class and primary key. If the entity instance is contained in the persistence context, it is returned from there.

Specified by:
find in interface javax.persistence.EntityManager
Parameters:
entityClass - entity class
primaryKey - primary key
Returns:
the found entity instance or null if the entity does not exist

find

public <X> X find(Class<X> entityClass,
                  Object primaryKey,
                  Map<String,Object> properties)
Description copied from interface: javax.persistence.EntityManager
Find by primary key, using the specified properties. Search for an entity of the specified class and primary key. If the entity instance is contained in the persistence context, it is returned from there. If a vendor-specific property or hint is not recognized, it is silently ignored.

Specified by:
find in interface javax.persistence.EntityManager
Parameters:
entityClass - entity class
primaryKey - primary key
properties - standard and vendor-specific properties and hints
Returns:
the found entity instance or null if the entity does not exist

find

public <X> X find(Key<X,?> key,
                  Map<String,Object> properties)
Retrieves the entity instance identified by the given Key.

Parameters:
key - The key to look up. Must not be null.
properties - JPA hints (standard and Errai-specific) for the lookup.
Returns:
the entity instance, or null if the entity cannot be found.

remove

public void remove(Object entity)
Description copied from interface: javax.persistence.EntityManager
Remove the entity instance.

Specified by:
remove in interface javax.persistence.EntityManager
Parameters:
entity - entity instance

removeAll

public void removeAll()
Removes everything from the backend data store and clears the persistence context.


createNamedQuery

public javax.persistence.Query createNamedQuery(String name)
Description copied from interface: javax.persistence.EntityManager
Create an instance of Query for executing a named query (in the Java Persistence query language or in native SQL).

Specified by:
createNamedQuery in interface javax.persistence.EntityManager
Parameters:
name - the name of a query defined in metadata
Returns:
the new query instance

createNamedQuery

public <T> javax.persistence.TypedQuery<T> createNamedQuery(String name,
                                                            Class<T> resultClass)
Description copied from interface: javax.persistence.EntityManager
Create an instance of 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.

Specified by:
createNamedQuery in interface javax.persistence.EntityManager
Parameters:
name - the name of a query defined in metadata
resultClass - the type of the query result
Returns:
the new query instance

merge

public <T> T merge(T entity)
Description copied from interface: javax.persistence.EntityManager
Merge the state of the given entity into the current persistence context.

Specified by:
merge in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
Returns:
the managed instance that the state was merged to

find

public <T> T find(Class<T> entityClass,
                  Object primaryKey,
                  javax.persistence.LockModeType lockMode)
Description copied from interface: javax.persistence.EntityManager
Find by primary key and lock. Search for an entity of the specified class and primary key and lock it with respect to the specified lock type. If the entity instance is contained in the persistence context, it is returned from there, and the effect of this method is the same as if the lock method had been called on the entity.

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:

Specified by:
find in interface javax.persistence.EntityManager
Parameters:
entityClass - entity class
primaryKey - primary key
lockMode - lock mode
Returns:
the found entity instance or null if the entity does not exist

find

public <T> T find(Class<T> entityClass,
                  Object primaryKey,
                  javax.persistence.LockModeType lockMode,
                  Map<String,Object> properties)
Description copied from interface: javax.persistence.EntityManager
Find by primary key and lock, using the specified properties. Search for an entity of the specified class and primary key and lock it with respect to the specified lock type. If the entity instance is contained in the persistence context, it is returned from there.

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:

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.

Specified by:
find in interface javax.persistence.EntityManager
Parameters:
entityClass - entity class
primaryKey - primary key
lockMode - lock mode
properties - standard and vendor-specific properties and hints
Returns:
the found entity instance or null if the entity does not exist

getReference

public <T> T getReference(Class<T> entityClass,
                          Object primaryKey)
Description copied from interface: javax.persistence.EntityManager
Get an instance, whose state may be lazily fetched. If the requested instance does not exist in the database, the EntityNotFoundException is thrown when the instance state is first accessed. (The persistence provider runtime is permitted to throw the EntityNotFoundException when getReference is called.) The application should not expect that the instance state will be available upon detachment, unless it was accessed by the application while the entity manager was open.

Specified by:
getReference in interface javax.persistence.EntityManager
Parameters:
entityClass - entity class
primaryKey - primary key
Returns:
the found entity instance

setFlushMode

public void setFlushMode(javax.persistence.FlushModeType flushMode)
Description copied from interface: javax.persistence.EntityManager
Set the flush mode that applies to all objects contained in the persistence context.

Specified by:
setFlushMode in interface javax.persistence.EntityManager
Parameters:
flushMode - flush mode

getFlushMode

public javax.persistence.FlushModeType getFlushMode()
Description copied from interface: javax.persistence.EntityManager
Get the flush mode that applies to all objects contained in the persistence context.

Specified by:
getFlushMode in interface javax.persistence.EntityManager
Returns:
flushMode

lock

public void lock(Object entity,
                 javax.persistence.LockModeType lockMode)
Description copied from interface: javax.persistence.EntityManager
Lock an entity instance that is contained in the persistence context with the specified lock mode type.

If a pessimistic lock mode type is specified and the entity contains a version attribute, the persistence provider must also 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:

Specified by:
lock in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
lockMode - lock mode

lock

public void lock(Object entity,
                 javax.persistence.LockModeType lockMode,
                 Map<String,Object> properties)
Description copied from interface: javax.persistence.EntityManager
Lock an entity instance that is contained in the persistence context with the specified lock mode type and with specified properties.

If a pessimistic lock mode type is specified and the entity contains a version attribute, the persistence provider must also 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:

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.

Specified by:
lock in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
lockMode - lock mode
properties - standard and vendor-specific properties and hints

refresh

public void refresh(Object entity)
Description copied from interface: javax.persistence.EntityManager
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.

Specified by:
refresh in interface javax.persistence.EntityManager
Parameters:
entity - entity instance

refresh

public void refresh(Object entity,
                    Map<String,Object> properties)
Description copied from interface: javax.persistence.EntityManager
Refresh the state of the instance from the database, using the specified properties, and overwriting changes made to the entity, if any.

If a vendor-specific property or hint is not recognized, it is silently ignored.

Specified by:
refresh in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
properties - standard and vendor-specific properties and hints

refresh

public void refresh(Object entity,
                    javax.persistence.LockModeType lockMode)
Description copied from interface: javax.persistence.EntityManager
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.

If the lock mode type is pessimistic and the entity instance is found but cannot be locked:

Specified by:
refresh in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
lockMode - lock mode

refresh

public void refresh(Object entity,
                    javax.persistence.LockModeType lockMode,
                    Map<String,Object> properties)
Description copied from interface: javax.persistence.EntityManager
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 and with specified properties.

If the lock mode type is pessimistic and the entity instance is found but cannot be locked:

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.

Specified by:
refresh in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
lockMode - lock mode
properties - standard and vendor-specific properties and hints

contains

public boolean contains(Object entity)
Description copied from interface: javax.persistence.EntityManager
Check if the instance is a managed entity instance belonging to the current persistence context.

Specified by:
contains in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
Returns:
boolean indicating if entity is in persistence context

getLockMode

public javax.persistence.LockModeType getLockMode(Object entity)
Description copied from interface: javax.persistence.EntityManager
Get the current lock mode for the entity instance.

Specified by:
getLockMode in interface javax.persistence.EntityManager
Parameters:
entity - entity instance
Returns:
lock mode

setProperty

public void setProperty(String propertyName,
                        Object value)
Description copied from interface: javax.persistence.EntityManager
Set an entity manager property or hint. If a vendor-specific property or hint is not recognized, it is silently ignored.

Specified by:
setProperty in interface javax.persistence.EntityManager
Parameters:
propertyName - name of property or hint
value - value for property or hint

getProperties

public Map<String,Object> getProperties()
Description copied from interface: javax.persistence.EntityManager
Get the properties and hints and associated values that are in effect for the entity manager. Changing the contents of the map does not change the configuration in effect.

Specified by:
getProperties in interface javax.persistence.EntityManager
Returns:
map of properties and hints in effect for entity manager

createQuery

public javax.persistence.Query createQuery(String qlString)
Description copied from interface: javax.persistence.EntityManager
Create an instance of Query for executing a Java Persistence query language statement.

Specified by:
createQuery in interface javax.persistence.EntityManager
Parameters:
qlString - a Java Persistence query string
Returns:
the new query instance

createQuery

public <T> javax.persistence.TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
Description copied from interface: javax.persistence.EntityManager
Create an instance of TypedQuery for executing a criteria query.

Specified by:
createQuery in interface javax.persistence.EntityManager
Parameters:
criteriaQuery - a criteria query object
Returns:
the new query instance

createQuery

public <T> javax.persistence.TypedQuery<T> createQuery(String qlString,
                                                       Class<T> resultClass)
Description copied from interface: javax.persistence.EntityManager
Create an instance of 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.

Specified by:
createQuery in interface javax.persistence.EntityManager
Parameters:
qlString - a Java Persistence query string
resultClass - the type of the query result
Returns:
the new query instance

createNativeQuery

public javax.persistence.Query createNativeQuery(String sqlString)
Description copied from interface: javax.persistence.EntityManager
Create an instance of Query for executing a native SQL statement, e.g., for update or delete.

Specified by:
createNativeQuery in interface javax.persistence.EntityManager
Parameters:
sqlString - a native SQL query string
Returns:
the new query instance

createNativeQuery

public javax.persistence.Query createNativeQuery(String sqlString,
                                                 Class resultClass)
Description copied from interface: javax.persistence.EntityManager
Create an instance of Query for executing a native SQL query.

Specified by:
createNativeQuery in interface javax.persistence.EntityManager
Parameters:
sqlString - a native SQL query string
resultClass - the class of the resulting instance(s)
Returns:
the new query instance

createNativeQuery

public javax.persistence.Query createNativeQuery(String sqlString,
                                                 String resultSetMapping)
Description copied from interface: javax.persistence.EntityManager
Create an instance of Query for executing a native SQL query.

Specified by:
createNativeQuery in interface javax.persistence.EntityManager
Parameters:
sqlString - a native SQL query string
resultSetMapping - the name of the result set mapping
Returns:
the new query instance

joinTransaction

public void joinTransaction()
Description copied from interface: javax.persistence.EntityManager
Indicate to the entity manager that a JTA transaction is active. This method should be called on a JTA application managed entity manager that was created outside the scope of the active transaction to associate it with the current JTA transaction.

Specified by:
joinTransaction in interface javax.persistence.EntityManager

unwrap

public <T> T unwrap(Class<T> cls)
Description copied from interface: javax.persistence.EntityManager
Return an object of the specified type to allow access to the provider-specific API. If the provider's EntityManager implementation does not support the specified class, the PersistenceException is thrown.

Specified by:
unwrap in interface javax.persistence.EntityManager
Parameters:
cls - the class of the object to be returned. This is normally either the underlying EntityManager implementation class or an interface that it implements.
Returns:
an instance of the specified class

getDelegate

public Object getDelegate()
Description copied from interface: javax.persistence.EntityManager
Return the underlying provider object for the EntityManager, if available. The result of this method is implementation specific. The unwrap method is to be preferred for new applications.

Specified by:
getDelegate in interface javax.persistence.EntityManager
Returns:
underlying provider object for EntityManager

close

public void close()
Description copied from interface: javax.persistence.EntityManager
Close an application-managed entity manager. After the close method has been invoked, all methods on the EntityManager instance and any Query and TypedQuery objects obtained from it will throw the IllegalStateException except for getProperties, getTransaction, and isOpen (which will return false). If this method is called when the entity manager is associated with an active transaction, the persistence context remains managed until the transaction completes.

Specified by:
close in interface javax.persistence.EntityManager

isOpen

public boolean isOpen()
Description copied from interface: javax.persistence.EntityManager
Determine whether the entity manager is open.

Specified by:
isOpen in interface javax.persistence.EntityManager
Returns:
true until the entity manager has been closed

getTransaction

public javax.persistence.EntityTransaction getTransaction()
Description copied from interface: javax.persistence.EntityManager
Return the resource-level EntityTransaction object. The EntityTransaction instance may be used serially to begin and commit multiple transactions.

Specified by:
getTransaction in interface javax.persistence.EntityManager
Returns:
EntityTransaction instance

getEntityManagerFactory

public javax.persistence.EntityManagerFactory getEntityManagerFactory()
Description copied from interface: javax.persistence.EntityManager
Return the entity manager factory for the entity manager.

Specified by:
getEntityManagerFactory in interface javax.persistence.EntityManager
Returns:
EntityManagerFactory instance

getCriteriaBuilder

public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
Description copied from interface: javax.persistence.EntityManager
Return an instance of CriteriaBuilder for the creation of CriteriaQuery objects.

Specified by:
getCriteriaBuilder in interface javax.persistence.EntityManager
Returns:
CriteriaBuilder instance

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.