public interface EntityManagerInvocationProvider
extends org.springframework.core.Ordered
<bean id="blWorkflowEntityManagerInvocationProviders" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
<ref bean="blSandBoxEntityManagerInvocationProvider"/>
</list>
</property>
</bean>
<bean class="org.broadleafcommerce.common.extensibility.context.merge.EarlyStageMergeBeanPostProcessor">
<property name="collectionRef" value="blWorkflowEntityManagerInvocationProviders"/>
<property name="targetRef" value="blEntityManagerInvocationProviders"/>
</bean>
Modifier and Type | Method and Description |
---|---|
void |
disableFilters(org.hibernate.Session session,
org.broadleafcommerce.common.web.BroadleafRequestContext context)
Disable
Filter for a session using @#getFilterEnablers() |
void |
enableFilters(org.hibernate.Session session,
org.broadleafcommerce.common.web.BroadleafRequestContext context)
Activate
Filter for a session using getFilterEnablers() |
List<FilterEnabler> |
getFilterEnablers() |
EntityManagerInvocationProviderResponse |
handleCriteriaOperation(boolean shouldPerformAnyFilter,
Object proxy,
Method method,
Object[] args,
javax.persistence.EntityManager em,
Object responseItem,
org.hibernate.Criteria criteria)
Handle a criteria operation
|
EntityManagerInvocationProviderResponse |
handleFindOperation(boolean shouldPerformAnyFilter,
Object proxy,
Method method,
Object[] args,
javax.persistence.EntityManager em,
Object responseItem)
Handle a find operation (
EntityManager.find(Class, Object) |
EntityManagerInvocationProviderResponse |
handlePersistence(boolean shouldPerformAnyFilter,
Object proxy,
Method method,
Object entity,
javax.persistence.EntityManager em)
Handle any call to
EntityManager.persist(Object) , EntityManager.merge(Object) or
EntityManager.remove(Object) |
EntityManagerInvocationProviderResponse |
handleQueryOperation(boolean shouldPerformAnyFilter,
Object proxy,
Method method,
Object[] args,
javax.persistence.EntityManager em,
Object responseItem,
Object query)
Handle a query operation
|
boolean |
isViableForEntityManager(javax.persistence.EntityManager em)
Determine whether this provider should be used with this EntityManager
|
void |
preHandleEntityManager(javax.persistence.EntityManager em)
Perform some work before handling any operation on an EntityManager
|
void |
setFilterEnablers(List<FilterEnabler> filterEnablers) |
void |
setOrder(int order)
The order in which this provider should be executed.
|
boolean |
shouldFilterOnFind(Class<?> entityClass)
Whether or not
Filter should be activated on a standard EntityManager.find(Class, Object) |
boolean |
shouldPerformFiltration(org.broadleafcommerce.common.web.BroadleafRequestContext context,
javax.persistence.EntityManager em)
Whether or not
Filter should be activated based on the broadleaf request context. |
boolean |
shouldPerformFiltration(org.broadleafcommerce.common.web.BroadleafRequestContext context,
org.hibernate.Session session)
Whether or not
Filter should be activated based on the broadleaf request context. |
List<FilterEnabler> getFilterEnablers()
void setFilterEnablers(List<FilterEnabler> filterEnablers)
void enableFilters(org.hibernate.Session session, org.broadleafcommerce.common.web.BroadleafRequestContext context)
Filter
for a session using getFilterEnablers()
session
- the Hibernate Sessioncontext
- the broadleaf request contextvoid disableFilters(org.hibernate.Session session, org.broadleafcommerce.common.web.BroadleafRequestContext context)
Filter
for a session using @#getFilterEnablers()
session
- the Hibernate Sessioncontext
- the broadleaf request contextboolean shouldPerformFiltration(org.broadleafcommerce.common.web.BroadleafRequestContext context, javax.persistence.EntityManager em)
Filter
should be activated based on the broadleaf request context.context
- the broadleaf request contextboolean shouldPerformFiltration(org.broadleafcommerce.common.web.BroadleafRequestContext context, org.hibernate.Session session)
Filter
should be activated based on the broadleaf request context.context
- the broadleaf request contextboolean shouldFilterOnFind(Class<?> entityClass)
Filter
should be activated on a standard EntityManager.find(Class, Object)
entityClass
- the entity typeEntityManagerInvocationProviderResponse handlePersistence(boolean shouldPerformAnyFilter, Object proxy, Method method, Object entity, javax.persistence.EntityManager em)
EntityManager.persist(Object)
, EntityManager.merge(Object)
or
EntityManager.remove(Object)
shouldPerformAnyFilter
- should Hibernate filters be active at allproxy
- the proxied instance of EntityManager
method
- the method on EntityManager being calledentity
- the entity instanceem
- the entity managerEntityManagerInvocationProviderResponse handleQueryOperation(boolean shouldPerformAnyFilter, Object proxy, Method method, Object[] args, javax.persistence.EntityManager em, Object responseItem, Object query)
shouldPerformAnyFilter
- should Hibernate filters be active at allproxy
- the proxied instance of Query
method
- the method on Query being calledargs
- the arguments provided to the method call on Queryem
- the entity managerresponseItem
- the result from any previous invocation of another invocation providerquery
- the original, un-proxied Query instanceQuery
EntityManagerInvocationProviderResponse handleFindOperation(boolean shouldPerformAnyFilter, Object proxy, Method method, Object[] args, javax.persistence.EntityManager em, Object responseItem)
EntityManager.find(Class, Object)
shouldPerformAnyFilter
- should Hibernate filters be active at allproxy
- the proxied instance of EntityManager
method
- the method on EntityManager being calledargs
- the arguments provided to the method call on Queryem
- the entity managerresponseItem
- the result from any previous invocation of another invocation providerEntityManagerInvocationProviderResponse handleCriteriaOperation(boolean shouldPerformAnyFilter, Object proxy, Method method, Object[] args, javax.persistence.EntityManager em, Object responseItem, org.hibernate.Criteria criteria)
shouldPerformAnyFilter
- should Hibernate filters be active at allproxy
- the proxied instance of Criteria
method
- the method on Criteria being calledargs
- the arguments provided to the method call on Queryem
- the entity managerresponseItem
- the result from any previous invocation of another invocation providercriteria
- the original, un-proxied Criteria instanceCriteria
void preHandleEntityManager(javax.persistence.EntityManager em)
em
- the entity managervoid setOrder(int order)
order
- the execution orderboolean isViableForEntityManager(javax.persistence.EntityManager em)
em
- Copyright © 2019. All rights reserved.