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.EntityManagergetEntityManager(Map<String, Object> managerMap) Gathers theEntityManagerfrom the provided managerMaporg.springframework.transaction.PlatformTransactionManagergetTransactionManager(Map<String, Object> managerMap) Gathers thePlatformTransactionManagerfrom the provided managerMapjakarta.persistence.EntityManageridentifyDefaultEntityManager(TargetModeType targetModeType) Identifies the defaultEntityManagerfor the given targetModeTypeorg.springframework.transaction.PlatformTransactionManageridentifyDefaultTransactionManager(TargetModeType targetModeType) Identifies the defaultPlatformTransactionManagerfor the given targetModeTypejakarta.persistence.EntityManageridentifyEntityManager(Class entityClass) Identifies theEntityManagerfor the given entityClass, using the default targetModeType ofTargetModeType.SANDBOXjakarta.persistence.EntityManageridentifyEntityManager(Class entityClass, TargetModeType targetModeType) Identifies theEntityManagerfor the given entityClass and targetModeTypeorg.springframework.transaction.PlatformTransactionManageridentifyTransactionManager(String className, TargetModeType targetModeType) Identifies thePlatformTransactionManagerfor the given className and targetModeTypebooleanvalidateEntityClassName(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 theEntityManagerfor the given entityClass, using the default targetModeType ofTargetModeType.SANDBOX- Parameters:
entityClass-- Returns:
- the
EntityManager
-
identifyEntityManager
jakarta.persistence.EntityManager identifyEntityManager(Class entityClass, TargetModeType targetModeType) Identifies theEntityManagerfor the given entityClass and targetModeType- Parameters:
entityClass-targetModeType-- Returns:
- the
EntityManager
-
identifyTransactionManager
org.springframework.transaction.PlatformTransactionManager identifyTransactionManager(String className, TargetModeType targetModeType) Identifies thePlatformTransactionManagerfor the given className and targetModeType- Parameters:
className-targetModeType-- Returns:
- the
PlatformTransactionManager
-
identifyDefaultEntityManager
Identifies the defaultEntityManagerfor the given targetModeTypeNOTE: This assumes that the
EntityManageris based on blPU- Parameters:
targetModeType-- Returns:
- the
EntityManager
-
identifyDefaultTransactionManager
org.springframework.transaction.PlatformTransactionManager identifyDefaultTransactionManager(TargetModeType targetModeType) Identifies the defaultPlatformTransactionManagerfor the given targetModeTypeNOTE: This assumes that the
PlatformTransactionManageris based on blPU- Parameters:
targetModeType-- Returns:
- the
PlatformTransactionManager
-
getEntityManager
Gathers theEntityManagerfrom the provided managerMap- Parameters:
managerMap-- Returns:
- the
EntityManager
-
getTransactionManager
org.springframework.transaction.PlatformTransactionManager getTransactionManager(Map<String, Object> managerMap) Gathers thePlatformTransactionManagerfrom 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-
-