Class PersistenceManagerFactory
java.lang.Object
org.broadleafcommerce.openadmin.server.service.persistence.PersistenceManagerFactory
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Service("blPersistenceManagerFactory")
public class PersistenceManagerFactory
extends Object
implements org.springframework.context.ApplicationContextAware
- Author:
- Jeff Fischer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected static EntityConfigurationprotected static Stringprotected static PersistenceService -
Constructor Summary
ConstructorsConstructorDescriptionPersistenceManagerFactory(PersistenceService persistenceService, EntityConfiguration entityConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprotected static ClassgetClassForName(String className) static PersistenceManagerThis method produces aPersistenceManagerwith a blPU-based standardEntityManager.static PersistenceManagergetDefaultPersistenceManager(TargetModeType targetModeType) This method produces aPersistenceManagerwith a blPU-based standardEntityManager using the passed inTargetModeTypestatic PersistenceManagerThis method should only be used within the context of a thread with an establishedPersistenceManagerContextand the operation to be performed is on an entity that is managed by theEntityManageridentified bystartPersistenceManager(TargetModeType).static PersistenceManagergetPersistenceManager(Class entityClass) static PersistenceManagergetPersistenceManager(Class entityClass, TargetModeType targetModeType) static PersistenceManagergetPersistenceManager(String className) static PersistenceManagergetPersistenceManager(String className, TargetModeType targetModeType) static Stringstatic booleanvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) static voidsetPersistenceManagerRef(String persistenceManagerRef) static voidstartPersistenceManager(String entityClassName, TargetModeType targetModeType) static voidstartPersistenceManager(TargetModeType targetModeType)
-
Field Details
-
DEFAULTPERSISTENCEMANAGERREF
- See Also:
-
persistenceManagerRef
-
persistenceService
-
entityConfiguration
-
-
Constructor Details
-
PersistenceManagerFactory
@Autowired public PersistenceManagerFactory(PersistenceService persistenceService, EntityConfiguration entityConfiguration)
-
-
Method Details
-
getPersistenceManager
This method should only be used within the context of a thread with an establishedPersistenceManagerContextand the operation to be performed is on an entity that is managed by theEntityManageridentified bystartPersistenceManager(TargetModeType).See
PersistenceThreadManager.operation(TargetModeType, Persistable)andstartPersistenceManager(TargetModeType)for an example of how the context is established. -
getPersistenceManager
-
getPersistenceManager
public static PersistenceManager getPersistenceManager(String className, TargetModeType targetModeType) -
getPersistenceManager
-
getDefaultPersistenceManager
This method produces aPersistenceManagerwith a blPU-based standardEntityManager. It also uses aTargetModeTypeofTargetModeType.SANDBOX -
getDefaultPersistenceManager
This method produces aPersistenceManagerwith a blPU-based standardEntityManager using the passed inTargetModeType -
getPersistenceManager
public static PersistenceManager getPersistenceManager(Class entityClass, TargetModeType targetModeType) -
isPersistenceManagerActive
public static boolean isPersistenceManagerActive() -
startPersistenceManager
-
startPersistenceManager
-
endPersistenceManager
public static void endPersistenceManager() -
getPersistenceManagerRef
-
setPersistenceManagerRef
-
getClassForName
-
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
-