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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPersistenceManagerFactory(org.broadleafcommerce.common.service.PersistenceService persistenceService, org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprotected static ClassgetClassForName(String className) static PersistenceManagerThis method produces aPersistenceManagerwith a blPU-based standardEntityManager.static PersistenceManagergetDefaultPersistenceManager(org.broadleafcommerce.common.persistence.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, org.broadleafcommerce.common.persistence.TargetModeType targetModeType) static PersistenceManagergetPersistenceManager(String className) static PersistenceManagergetPersistenceManager(String className, org.broadleafcommerce.common.persistence.TargetModeType targetModeType) static Stringstatic booleanvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) static voidsetPersistenceManagerRef(String persistenceManagerRef) static voidstartPersistenceManager(String entityClassName, org.broadleafcommerce.common.persistence.TargetModeType targetModeType) static voidstartPersistenceManager(org.broadleafcommerce.common.persistence.TargetModeType targetModeType)
-
Field Details
-
DEFAULTPERSISTENCEMANAGERREF
- See Also:
-
persistenceManagerRef
-
persistenceService
protected static org.broadleafcommerce.common.service.PersistenceService persistenceService -
entityConfiguration
protected static org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
-
-
Constructor Details
-
PersistenceManagerFactory
@Autowired public PersistenceManagerFactory(org.broadleafcommerce.common.service.PersistenceService persistenceService, org.broadleafcommerce.common.persistence.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, org.broadleafcommerce.common.persistence.TargetModeType targetModeType) -
getPersistenceManager
-
getDefaultPersistenceManager
This method produces aPersistenceManagerwith a blPU-based standardEntityManager. It also uses aTargetModeTypeofTargetModeType.SANDBOX -
getDefaultPersistenceManager
public static PersistenceManager getDefaultPersistenceManager(org.broadleafcommerce.common.persistence.TargetModeType targetModeType) This method produces aPersistenceManagerwith a blPU-based standardEntityManager using the passed inTargetModeType -
getPersistenceManager
public static PersistenceManager getPersistenceManager(Class entityClass, org.broadleafcommerce.common.persistence.TargetModeType targetModeType) -
isPersistenceManagerActive
public static boolean isPersistenceManagerActive() -
startPersistenceManager
public static void startPersistenceManager(org.broadleafcommerce.common.persistence.TargetModeType targetModeType) -
startPersistenceManager
public static void startPersistenceManager(String entityClassName, org.broadleafcommerce.common.persistence.TargetModeType targetModeType) -
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
-