Package org.hibernate.testing.orm.junit
Class EntityManagerFactoryBasedFunctionalTest
- java.lang.Object
-
- org.hibernate.testing.orm.junit.EntityManagerFactoryBasedFunctionalTest
-
- All Implemented Interfaces:
EntityManagerFactoryProducer
,EntityManagerFactoryScopeContainer
public class EntityManagerFactoryBasedFunctionalTest extends Object implements EntityManagerFactoryProducer, EntityManagerFactoryScopeContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntityManagerFactoryBasedFunctionalTest.TestingPersistenceUnitDescriptorImpl
-
Field Summary
Fields Modifier and Type Field Description protected static Class<?>[]
NO_CLASSES
protected static String[]
NO_MAPPINGS
-
Constructor Summary
Constructors Constructor Description EntityManagerFactoryBasedFunctionalTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addConfigOptions(Map options)
void
afterTest()
protected void
applySettings(Map<Object,Object> settings)
protected PersistenceUnitDescriptor
buildPersistenceUnitDescriptor()
protected Map<Object,Object>
buildSettings()
protected void
cleanupTestData()
Tests should ideally override this standard implementation; it may not work in all cases (e.g.protected jakarta.persistence.EntityManagerFactory
entityManagerFactory()
protected void
entityManagerFactoryBuilt(jakarta.persistence.EntityManagerFactory factory)
protected EntityManagerFactoryScope
entityManagerFactoryScope()
protected boolean
exportSchema()
protected <T> T
fromEntityManager(Function<jakarta.persistence.EntityManager,T> action)
protected <T> T
fromTransaction(Function<jakarta.persistence.EntityManager,T> action)
protected Class<?>[]
getAnnotatedClasses()
Map<Class,String>
getCachedClasses()
Map<String,String>
getCachedCollections()
protected Map<Object,Object>
getConfig()
String[]
getEjb3DD()
EntityManagerFactoryProducer
getEntityManagerFactoryProducer()
Obtain theEntityManagerFactoryProducer
.protected String[]
getMappings()
protected void
inEntityManager(Consumer<jakarta.persistence.EntityManager> action)
void
injectEntityManagerFactoryScope(EntityManagerFactoryScope scope)
Callback to inject the EntityManagerFactoryScope into the container.protected void
inTransaction(Consumer<jakarta.persistence.EntityManager> action)
protected boolean
isCleanupTestDataRequired()
jakarta.persistence.EntityManagerFactory
produceEntityManagerFactory()
protected boolean
strictJpaCompliance()
-
-
-
Method Detail
-
produceEntityManagerFactory
public jakarta.persistence.EntityManagerFactory produceEntityManagerFactory()
- Specified by:
produceEntityManagerFactory
in interfaceEntityManagerFactoryProducer
-
injectEntityManagerFactoryScope
public void injectEntityManagerFactoryScope(EntityManagerFactoryScope scope)
Description copied from interface:EntityManagerFactoryScopeContainer
Callback to inject the EntityManagerFactoryScope into the container.- Specified by:
injectEntityManagerFactoryScope
in interfaceEntityManagerFactoryScopeContainer
-
getEntityManagerFactoryProducer
public EntityManagerFactoryProducer getEntityManagerFactoryProducer()
Description copied from interface:EntityManagerFactoryScopeContainer
Obtain theEntityManagerFactoryProducer
. Quite often this is also implemented by the container itself.- Specified by:
getEntityManagerFactoryProducer
in interfaceEntityManagerFactoryScopeContainer
-
entityManagerFactoryScope
protected EntityManagerFactoryScope entityManagerFactoryScope()
-
entityManagerFactory
protected jakarta.persistence.EntityManagerFactory entityManagerFactory()
-
entityManagerFactoryBuilt
protected void entityManagerFactoryBuilt(jakarta.persistence.EntityManagerFactory factory)
-
strictJpaCompliance
protected boolean strictJpaCompliance()
-
exportSchema
protected boolean exportSchema()
-
getMappings
protected String[] getMappings()
-
addConfigOptions
protected void addConfigOptions(Map options)
-
getAnnotatedClasses
protected Class<?>[] getAnnotatedClasses()
-
getEjb3DD
public String[] getEjb3DD()
-
buildPersistenceUnitDescriptor
protected PersistenceUnitDescriptor buildPersistenceUnitDescriptor()
-
afterTest
@AfterEach public final void afterTest()
-
isCleanupTestDataRequired
protected boolean isCleanupTestDataRequired()
-
cleanupTestData
protected void cleanupTestData()
Tests should ideally override this standard implementation; it may not work in all cases (e.g. with @Embeddable entities)
-
inTransaction
protected void inTransaction(Consumer<jakarta.persistence.EntityManager> action)
-
fromTransaction
protected <T> T fromTransaction(Function<jakarta.persistence.EntityManager,T> action)
-
inEntityManager
protected void inEntityManager(Consumer<jakarta.persistence.EntityManager> action)
-
fromEntityManager
protected <T> T fromEntityManager(Function<jakarta.persistence.EntityManager,T> action)
-
-