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 SecurityVerifierprotected org.springframework.context.ApplicationContextprotected List<CustomPersistenceHandlerFilter>protected List<CustomPersistenceHandler>protected DynamicEntityDaoprotected EntityParentIdServiceExtensionManagerprotected FetchTypeDetectionprotected PersistenceModule[]protected List<PersistenceManagerEventHandler>protected PersistenceServiceprotected TargetModeType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(PersistencePackage persistencePackage) buildClassMetadata(Class<?>[] entities, PersistencePackage persistencePackage, Map<MergedPropertyType, Map<String, FieldMetadata>> mergedProperties) voidconfigureDefaultDynamicEntityDao(TargetModeType targetModeType) This method produces aDynamicEntityDaowith a blPU-based standardEntityManager using the passed inTargetModeTypevoidconfigureDynamicEntityDao(Class entityClass, TargetModeType targetModeType) protected voidexecuteDeferredOperations(PersistencePackage persistencePackage) protected PersistenceResponseexecutePostAddHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponseexecutePostFetchHandlers(PersistencePackage persistencePackage, CriteriaTransferObject cto, PersistenceResponse persistenceResponse) protected PersistenceResponseexecutePostInspectHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponseexecutePostRemoveHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponseexecutePostUpdateHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected PersistenceResponseexecuteValidationProcessors(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) fetch(PersistencePackage persistencePackage, CriteriaTransferObject cto) Class<?>[]getAllPolymorphicEntitiesFromCeiling(Class<?> ceilingClass) getCompatibleModule(OperationType operationType) protected jakarta.persistence.EntityManagergetDefaultEntityManager(TargetModeType targetModeType) protected jakarta.persistence.EntityManagergetEntityManager(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 voidHonor 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 voidlogValidationError(Entity response) protected EntitypostAdd(Entity entity, PersistencePackage persistencePackage) Deprecated.use the PersistenceManagerEventHandler api insteadvoidprotected DynamicResultSetpostFetch(DynamicResultSet resultSet, PersistencePackage persistencePackage, CriteriaTransferObject cto) Deprecated.use the PersistenceManagerEventHandler api insteadprotected voidpostFetchValidation(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) protected EntitypostUpdate(Entity entity, PersistencePackage persistencePackage) Deprecated.use the PersistenceManagerEventHandler api insteadProperty[]processMergedProperties(Class<?>[] entities, Map<MergedPropertyType, Map<String, FieldMetadata>> mergedProperties) remove(PersistencePackage persistencePackage) voidsetAdminRemoteSecurityService(AdminSecurityServiceRemote adminRemoteSecurityService) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetCustomPersistenceHandlerFilters(List<CustomPersistenceHandlerFilter> customPersistenceHandlerFilters) voidsetCustomPersistenceHandlers(List<CustomPersistenceHandler> customPersistenceHandlers) voidsetDynamicEntityDao(DynamicEntityDao dynamicEntityDao) protected voidsetMainEntityName(PersistencePackage pp, Entity entity) voidsetModules(PersistenceModule[] modules) voidsetTargetMode(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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getAllPolymorphicEntitiesFromCeiling
- Specified by:
getAllPolymorphicEntitiesFromCeilingin interfacePersistenceManager
-
getUpDownInheritance
- Specified by:
getUpDownInheritancein interfacePersistenceManager- Throws:
ClassNotFoundException
-
getUpDownInheritance
- Specified by:
getUpDownInheritancein interfacePersistenceManager
-
getPolymorphicEntities
public Class<?>[] getPolymorphicEntities(String ceilingEntityFullyQualifiedClassname) throws ClassNotFoundException - Specified by:
getPolymorphicEntitiesin interfacePersistenceManager- Throws:
ClassNotFoundException
-
getSimpleMergedProperties
public Map<String,FieldMetadata> getSimpleMergedProperties(String entityName, PersistencePerspective persistencePerspective) - Specified by:
getSimpleMergedPropertiesin interfaceInspectHelper- Specified by:
getSimpleMergedPropertiesin 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:
buildClassMetadatain interfaceInspectHelper- Specified by:
buildClassMetadatain interfacePersistenceManager
-
inspect
public PersistenceResponse inspect(PersistencePackage persistencePackage) throws ServiceException, ClassNotFoundException - Specified by:
inspectin interfacePersistenceManager- Throws:
ServiceExceptionClassNotFoundException
-
getIdPropertyName
- Specified by:
getIdPropertyNamein 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:
fetchin 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:
addin 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:
updatein 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:
removein interfacePersistenceManager- Throws:
ServiceException
-
executePostRemoveHandlers
protected PersistenceResponse executePostRemoveHandlers(PersistencePackage persistencePackage, PersistenceResponse persistenceResponse) throws ServiceException - Throws:
ServiceException
-
getCompatibleModule
- Specified by:
getCompatibleModulein interfaceInspectHelper
-
configureDynamicEntityDao
- Specified by:
configureDynamicEntityDaoin interfacePersistenceManager
-
getEntityManager
protected jakarta.persistence.EntityManager getEntityManager(Class entityClass, TargetModeType targetModeType) -
configureDefaultDynamicEntityDao
Description copied from interface:PersistenceManagerThis method produces aDynamicEntityDaowith a blPU-based standardEntityManager using the passed inTargetModeType- Specified by:
configureDefaultDynamicEntityDaoin interfacePersistenceManager
-
getDefaultEntityManager
-
getDynamicEntityDao
- Specified by:
getDynamicEntityDaoin interfacePersistenceManager
-
setDynamicEntityDao
- Specified by:
setDynamicEntityDaoin interfacePersistenceManager
-
getTargetMode
- Specified by:
getTargetModein interfacePersistenceManager
-
setTargetMode
- Specified by:
setTargetModein interfacePersistenceManager
-
getCustomPersistenceHandlers
- Specified by:
getCustomPersistenceHandlersin interfacePersistenceManager
-
setCustomPersistenceHandlers
- Specified by:
setCustomPersistenceHandlersin 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
-