|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.unitils.orm.jpa.JpaUnitils
public class JpaUnitils
Utility facade for handling JPA related stuff such as asserting whether the mappings correspond to the actual structure of the database.
Constructor Summary | |
---|---|
JpaUnitils()
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JpaUnitils()
Method Detail |
---|
public static void assertMappingWithDatabaseConsistent()
public static void flushDatabaseUpdates()
EntityManager
public static void injectEntityManagerInto(Object target)
EntityManager
into
fields or methods annotated with javax.persistence.PersistenceContext
target
- 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |