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.Log
protected PersistenceService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
<T> T
Find and return the entity by primary key and class.<T> T
findSandboxEntity
(Class<T> clazz, Object id) If within the context of a sandbox, return the sandbox entity by primary key and class.protected jakarta.persistence.EntityManager
getEntityManager
(Class clazz) static PostLoaderDao
static void
resetApplicationContext
(org.springframework.context.ApplicationContext applicationContext) see org.broadleafcommerce.test.TestNGSiteIntegrationSetup#reSetApplicationContext()void
setApplicationContext
(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:
setApplicationContext
in 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:
find
in interfacePostLoaderDao
- Parameters:
clazz
- entity classid
- primary key- Returns:
- managed entity or null if not found
-
findSandboxEntity
Description copied from interface:PostLoaderDao
If 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:
findSandboxEntity
in interfacePostLoaderDao
- Returns:
-
evict
- Specified by:
evict
in interfacePostLoaderDao
-
evict
- Specified by:
evict
in interfacePostLoaderDao
-
getEntityManager
-