public class JpaUnitils extends Object
| Constructor and Description |
|---|
JpaUnitils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertMappingWithDatabaseConsistent()
Checks if the mapping of the JPA entities with the database is still correct for the configurations
that are loaded for the current test.
|
static void |
flushDatabaseUpdates()
Flushes all pending entity manager updates to the database.
|
static javax.persistence.EntityManager |
getEntityManager() |
static javax.persistence.EntityManagerFactory |
getEntityManagerFactory() |
static void |
injectEntityManagerInto(Object target)
For the given target object, injects the active, transactional
EntityManager into
fields or methods annotated with javax.persistence.PersistenceContext |
public static void assertMappingWithDatabaseConsistent()
public static void flushDatabaseUpdates()
EntityManagerpublic static void injectEntityManagerInto(Object target)
EntityManager into
fields or methods annotated with javax.persistence.PersistenceContexttarget - public static javax.persistence.EntityManagerFactory getEntityManagerFactory()
EntityManagerFactory configured for the current test object (spring or using
the JpaEntityManagerFactory annotation.public static javax.persistence.EntityManager getEntityManager()
EntityManager associated with the current transaction. This method returns the
same EntityManager during the course of a transaction.Copyright © 2016. All Rights Reserved.