Class PersistenceManagerImpl
java.lang.Object
org.broadleafcommerce.openadmin.server.service.persistence.PersistenceManagerImpl
- All Implemented Interfaces:
InspectHelper
,PersistenceManager
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
@Component("blPersistenceManager")
@Scope("prototype")
public class PersistenceManagerImpl
extends Object
implements InspectHelper, PersistenceManager, org.springframework.context.ApplicationContextAware
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SecurityVerifier
protected org.springframework.context.ApplicationContext
protected List<CustomPersistenceHandlerFilter>
protected List<CustomPersistenceHandler>
protected DynamicEntityDao
protected EntityParentIdServiceExtensionManager
protected FetchTypeDetection
protected PersistenceModule[]
protected List<PersistenceManagerEventHandler>
protected PersistenceService
protected TargetModeType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(PersistencePackage persistencePackage) buildClassMetadata
(Class<?>[] entities, PersistencePackage persistencePackage, Map<MergedPropertyType, Map<String, FieldMetadata>> mergedProperties) void
configureDefaultDynamicEntityDao
(TargetModeType targetModeType) This method produces aDynamicEntityDao
with a blPU-based standardEntityManager using the passed inTargetModeType
void
configureDynamicEntityDao
(Class entityClass, TargetModeType targetModeType) protected void
executeDeferredOperations
(PersistencePackage persistencePackage) protected PersistenceResponse
executePostAddHandlers
(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponse
executePostFetchHandlers
(PersistencePackage persistencePackage, CriteriaTransferObject cto, PersistenceResponse persistenceResponse) protected PersistenceResponse
executePostInspectHandlers
(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponse
executePostRemoveHandlers
(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponse
executePostUpdateHandlers
(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponse
executeValidationProcessors
(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) fetch
(PersistencePackage persistencePackage, CriteriaTransferObject cto) Class<?>[]
getAllPolymorphicEntitiesFromCeiling
(Class<?> ceilingClass) getCompatibleModule
(OperationType operationType) protected jakarta.persistence.EntityManager
getDefaultEntityManager
(TargetModeType targetModeType) protected jakarta.persistence.EntityManager
getEntityManager
(Class entityClass, TargetModeType targetModeType) getIdPropertyName
(String entityClass) Class<?>[]
getPolymorphicEntities
(String ceilingEntityFullyQualifiedClassname) getSimpleMergedProperties
(String entityName, PersistencePerspective persistencePerspective) Class<?>[]
getUpDownInheritance
(Class<?> testClass) Class<?>[]
getUpDownInheritance
(String testClassname) protected void
Honor ordering for those CPH instances that have explicitly declared a order other than the default order This achieves several goals: 1.inspect
(PersistencePackage persistencePackage) protected void
logValidationError
(Entity response) protected Entity
postAdd
(Entity entity, PersistencePackage persistencePackage) Deprecated.use the PersistenceManagerEventHandler api insteadvoid
protected DynamicResultSet
postFetch
(DynamicResultSet resultSet, PersistencePackage persistencePackage, CriteriaTransferObject cto) Deprecated.use the PersistenceManagerEventHandler api insteadprotected void
postFetchValidation
(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected Entity
postUpdate
(Entity entity, PersistencePackage persistencePackage) Deprecated.use the PersistenceManagerEventHandler api insteadProperty[]
processMergedProperties
(Class<?>[] entities, Map<MergedPropertyType, Map<String, FieldMetadata>> mergedProperties) remove
(PersistencePackage persistencePackage) void
setAdminRemoteSecurityService
(AdminSecurityServiceRemote adminRemoteSecurityService) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setCustomPersistenceHandlerFilters
(List<CustomPersistenceHandlerFilter> customPersistenceHandlerFilters) void
setCustomPersistenceHandlers
(List<CustomPersistenceHandler> customPersistenceHandlers) void
setDynamicEntityDao
(DynamicEntityDao dynamicEntityDao) protected void
setMainEntityName
(PersistencePackage pp, Entity entity) void
setModules
(PersistenceModule[] modules) void
setTargetMode
(TargetModeType targetMode) update
(PersistencePackage persistencePackage)
-
Field Details
-
dynamicEntityDao
-
persistenceService
-
customPersistenceHandlers
-
customPersistenceHandlerFilters
-
adminRemoteSecurityService
-
modules
-
persistenceManagerEventHandlers
-
extensionManager
-
fetchDetection
-
targetMode
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
PersistenceManagerImpl
public PersistenceManagerImpl()
-
-
Method Details
-
postConstruct
@PostConstruct public void postConstruct() -
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
getAllPolymorphicEntitiesFromCeiling
- Specified by:
getAllPolymorphicEntitiesFromCeiling
in interfacePersistenceManager
-
getUpDownInheritance
- Specified by:
getUpDownInheritance
in interfacePersistenceManager
- Throws:
ClassNotFoundException
-
getUpDownInheritance
- Specified by:
getUpDownInheritance
in interfacePersistenceManager
-
getPolymorphicEntities
public Class<?>[] getPolymorphicEntities(String ceilingEntityFullyQualifiedClassname) throws ClassNotFoundException - Specified by:
getPolymorphicEntities
in interfacePersistenceManager
- Throws:
ClassNotFoundException
-
getSimpleMergedProperties
public Map<String,FieldMetadata> getSimpleMergedProperties(String entityName, PersistencePerspective persistencePerspective) - Specified by:
getSimpleMergedProperties
in interfaceInspectHelper
- Specified by:
getSimpleMergedProperties
in interfacePersistenceManager
-
processMergedProperties
public Property[] processMergedProperties(Class<?>[] entities, Map<MergedPropertyType, Map<String, FieldMetadata>> mergedProperties) -
buildClassMetadata
public ClassMetadata buildClassMetadata(Class<?>[] entities, PersistencePackage persistencePackage, Map<MergedPropertyType, Map<String, FieldMetadata>> mergedProperties) - Specified by:
buildClassMetadata
in interfaceInspectHelper
- Specified by:
buildClassMetadata
in interfacePersistenceManager
-
inspect
public PersistenceResponse inspect(PersistencePackage persistencePackage) throws ServiceException, ClassNotFoundException - Specified by:
inspect
in interfacePersistenceManager
- Throws:
ServiceException
ClassNotFoundException
-
getIdPropertyName
- Specified by:
getIdPropertyName
in interfacePersistenceManager
-
executePostInspectHandlers
protected PersistenceResponse executePostInspectHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
fetch
public PersistenceResponse fetch(PersistencePackage persistencePackage, CriteriaTransferObject cto) throws ServiceException - Specified by:
fetch
in interfacePersistenceManager
- Throws:
ServiceException
-
executePostFetchHandlers
protected PersistenceResponse executePostFetchHandlers(PersistencePackage persistencePackage, CriteriaTransferObject cto, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
postFetchValidation
protected void postFetchValidation(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
postFetch
@Deprecated protected DynamicResultSet postFetch(DynamicResultSet resultSet, PersistencePackage persistencePackage, CriteriaTransferObject cto) throws ServiceException Deprecated.use the PersistenceManagerEventHandler api insteadCalled after the fetch event- Parameters:
resultSet
-persistencePackage
-cto
-- Returns:
- the modified result set
- Throws:
ServiceException
-
add
- Specified by:
add
in interfacePersistenceManager
- Throws:
ServiceException
-
executeValidationProcessors
protected PersistenceResponse executeValidationProcessors(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
executePostAddHandlers
protected PersistenceResponse executePostAddHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
executeDeferredOperations
protected void executeDeferredOperations(PersistencePackage persistencePackage) throws ServiceException - Throws:
ServiceException
-
postAdd
@Deprecated protected Entity postAdd(Entity entity, PersistencePackage persistencePackage) throws ServiceException Deprecated.use the PersistenceManagerEventHandler api insteadCalled after the add event- Parameters:
entity
-persistencePackage
-- Returns:
- the modified Entity instance
- Throws:
ServiceException
-
update
- Specified by:
update
in interfacePersistenceManager
- Throws:
ServiceException
-
logValidationError
-
executePostUpdateHandlers
protected PersistenceResponse executePostUpdateHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
postUpdate
@Deprecated protected Entity postUpdate(Entity entity, PersistencePackage persistencePackage) throws ServiceException Deprecated.use the PersistenceManagerEventHandler api insteadCalled after the update event- Parameters:
entity
-persistencePackage
-- Returns:
- the modified Entity instance
- Throws:
ServiceException
-
remove
- Specified by:
remove
in interfacePersistenceManager
- Throws:
ServiceException
-
executePostRemoveHandlers
protected PersistenceResponse executePostRemoveHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
getCompatibleModule
- Specified by:
getCompatibleModule
in interfaceInspectHelper
-
configureDynamicEntityDao
- Specified by:
configureDynamicEntityDao
in interfacePersistenceManager
-
getEntityManager
protected jakarta.persistence.EntityManager getEntityManager(Class entityClass, TargetModeType targetModeType) -
configureDefaultDynamicEntityDao
Description copied from interface:PersistenceManager
This method produces aDynamicEntityDao
with a blPU-based standardEntityManager using the passed inTargetModeType
- Specified by:
configureDefaultDynamicEntityDao
in interfacePersistenceManager
-
getDefaultEntityManager
-
getDynamicEntityDao
- Specified by:
getDynamicEntityDao
in interfacePersistenceManager
-
setDynamicEntityDao
- Specified by:
setDynamicEntityDao
in interfacePersistenceManager
-
getTargetMode
- Specified by:
getTargetMode
in interfacePersistenceManager
-
setTargetMode
- Specified by:
setTargetMode
in interfacePersistenceManager
-
getCustomPersistenceHandlers
- Specified by:
getCustomPersistenceHandlers
in interfacePersistenceManager
-
setCustomPersistenceHandlers
- Specified by:
setCustomPersistenceHandlers
in interfacePersistenceManager
-
setMainEntityName
-
getAdminRemoteSecurityService
-
setAdminRemoteSecurityService
-
getCustomPersistenceHandlerFilters
-
setCustomPersistenceHandlerFilters
public void setCustomPersistenceHandlerFilters(List<CustomPersistenceHandlerFilter> customPersistenceHandlerFilters) -
getModules
-
setModules
-
honorExplicitPersistenceHandlerSorting
protected void honorExplicitPersistenceHandlerSorting()Honor ordering for those CPH instances that have explicitly declared a order other than the default order This achieves several goals: 1. We leave the general CPH population in its established order, which is the best for backwards compatibility 2. Those items that are intended to get explicit ordering still achieve their goal
-