Class DefaultPostLoaderDao
java.lang.Object
org.broadleafcommerce.common.persistence.DefaultPostLoaderDao
- All Implemented Interfaces:
PostLoaderDao,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Component("blPostLoaderDao")
public class DefaultPostLoaderDao
extends Object
implements PostLoaderDao, org.springframework.context.ApplicationContextAware
- Author:
- Nathan Moore (nathanmoore).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.Logprotected PersistenceService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoid<T> TFind and return the entity by primary key and class.<T> TfindSandboxEntity(Class<T> clazz, Object id) If within the context of a sandbox, return the sandbox entity by primary key and class.protected jakarta.persistence.EntityManagergetEntityManager(Class clazz) static PostLoaderDaostatic voidresetApplicationContext(org.springframework.context.ApplicationContext applicationContext) see org.broadleafcommerce.test.TestNGSiteIntegrationSetup#reSetApplicationContext()voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
persistenceService
-
-
Constructor Details
-
DefaultPostLoaderDao
public DefaultPostLoaderDao()
-
-
Method Details
-
getPostLoaderDao
-
resetApplicationContext
public static void resetApplicationContext(org.springframework.context.ApplicationContext applicationContext) see org.broadleafcommerce.test.TestNGSiteIntegrationSetup#reSetApplicationContext()- Parameters:
applicationContext-
-
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
-
find
Find and return the entity by primary key and class.Delegates find to
EntityManager.find(Class, Object).- Specified by:
findin interfacePostLoaderDao- Parameters:
clazz- entity classid- primary key- Returns:
- managed entity or null if not found
-
findSandboxEntity
Description copied from interface:PostLoaderDaoIf within the context of a sandbox, return the sandbox entity by primary key and class.This purposefully uses the Entity Manager in order to trigger the hibernate filters.
- Specified by:
findSandboxEntityin interfacePostLoaderDao- Returns:
-
evict
- Specified by:
evictin interfacePostLoaderDao
-
evict
- Specified by:
evictin interfacePostLoaderDao
-
getEntityManager
-