Interface PersistenceService
- All Known Implementing Classes:
PersistenceServiceImpl
public interface PersistenceService
- Author:
- Chris Kittrell (ckittrell)
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
getCeilingImplClassFromEntityManagers
(String className) Retrieves the topmost implementation for the given className by checking each registeredEntityManager
.jakarta.persistence.EntityManager
getEntityManager
(Map<String, Object> managerMap) Gathers theEntityManager
from the provided managerMaporg.springframework.transaction.PlatformTransactionManager
getTransactionManager
(Map<String, Object> managerMap) Gathers thePlatformTransactionManager
from the provided managerMapjakarta.persistence.EntityManager
identifyDefaultEntityManager
(TargetModeType targetModeType) Identifies the defaultEntityManager
for the given targetModeTypeorg.springframework.transaction.PlatformTransactionManager
identifyDefaultTransactionManager
(TargetModeType targetModeType) Identifies the defaultPlatformTransactionManager
for the given targetModeTypejakarta.persistence.EntityManager
identifyEntityManager
(Class entityClass) Identifies theEntityManager
for the given entityClass, using the default targetModeType ofTargetModeType.SANDBOX
jakarta.persistence.EntityManager
identifyEntityManager
(Class entityClass, TargetModeType targetModeType) Identifies theEntityManager
for the given entityClass and targetModeTypeorg.springframework.transaction.PlatformTransactionManager
identifyTransactionManager
(String className, TargetModeType targetModeType) Identifies thePlatformTransactionManager
for the given className and targetModeTypeboolean
validateEntityClassName
(String entityClassName) Determine if a test class name represents a known entity class registered with Hibernate
-
Method Details
-
validateEntityClassName
Determine if a test class name represents a known entity class registered with Hibernate- Parameters:
entityClassName
-- Returns:
-
identifyEntityManager
Identifies theEntityManager
for the given entityClass, using the default targetModeType ofTargetModeType.SANDBOX
- Parameters:
entityClass
-- Returns:
- the
EntityManager
-
identifyEntityManager
jakarta.persistence.EntityManager identifyEntityManager(Class entityClass, TargetModeType targetModeType) Identifies theEntityManager
for the given entityClass and targetModeType- Parameters:
entityClass
-targetModeType
-- Returns:
- the
EntityManager
-
identifyTransactionManager
org.springframework.transaction.PlatformTransactionManager identifyTransactionManager(String className, TargetModeType targetModeType) Identifies thePlatformTransactionManager
for the given className and targetModeType- Parameters:
className
-targetModeType
-- Returns:
- the
PlatformTransactionManager
-
identifyDefaultEntityManager
Identifies the defaultEntityManager
for the given targetModeTypeNOTE: This assumes that the
EntityManager
is based on blPU- Parameters:
targetModeType
-- Returns:
- the
EntityManager
-
identifyDefaultTransactionManager
org.springframework.transaction.PlatformTransactionManager identifyDefaultTransactionManager(TargetModeType targetModeType) Identifies the defaultPlatformTransactionManager
for the given targetModeTypeNOTE: This assumes that the
PlatformTransactionManager
is based on blPU- Parameters:
targetModeType
-- Returns:
- the
PlatformTransactionManager
-
getEntityManager
Gathers theEntityManager
from the provided managerMap- Parameters:
managerMap
-- Returns:
- the
EntityManager
-
getTransactionManager
org.springframework.transaction.PlatformTransactionManager getTransactionManager(Map<String, Object> managerMap) Gathers thePlatformTransactionManager
from the provided managerMap- Parameters:
managerMap
-- Returns:
- the
PlatformTransactionManager
-
getCeilingImplClassFromEntityManagers
Retrieves the topmost implementation for the given className by checking each registeredEntityManager
. If this is not found in the entity managers, this returns null- Parameters:
className
-
-