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 TypeMethodDescription<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 javax.persistence.EntityManagergetEntityManager(Class clazz) static PostLoaderDaovoidsetApplicationContext(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
-
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 toEntityManager.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:
-
getEntityManager
-