public class EntityManagerProvider extends Object implements org.junit.rules.TestRule
| Modifier and Type | Method and Description |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
static EntityManagerProvider |
clear()
clears entityManager persistence context of current instance of this provider
|
static EntityManagerProvider |
clear(String puName) |
Connection |
connection() |
Connection |
connection(String puName) |
static javax.persistence.EntityManager |
em() |
static javax.persistence.EntityManager |
em(String puName) |
static EntityManagerProvider |
instance(String unitName) |
static boolean |
isEntityManagerActive() |
static EntityManagerProvider |
newInstance(String unitName) |
static javax.persistence.EntityTransaction |
tx() |
static javax.persistence.EntityTransaction |
tx(String puName) |
public static EntityManagerProvider instance(String unitName)
public static EntityManagerProvider newInstance(String unitName)
unitName - unit name
clear entities on underlying contextpublic Connection connection(String puName)
puName - unit namepublic Connection connection()
public static javax.persistence.EntityManager em(String puName)
puName - unit namepublic static javax.persistence.EntityManager em()
public static EntityManagerProvider clear(String puName)
puName - unit name
clears entityManager (represented by given puName) persistence contextpublic static EntityManagerProvider clear()
public static javax.persistence.EntityTransaction tx(String puName)
puName - unit namepublic static javax.persistence.EntityTransaction tx()
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRulepublic static boolean isEntityManagerActive()
Copyright © 2016. All rights reserved.