Class BusinessUnitQueryBuilderInterceptor
java.lang.Object
ch.tocco.nice2.businessunit.impl.intercept.BusinessUnitInterceptorHelper
ch.tocco.nice2.businessunit.impl.intercept.BusinessUnitQueryBuilderInterceptor
- All Implemented Interfaces:
QueryBuilderInterceptor
@Component
public class BusinessUnitQueryBuilderInterceptor
extends BusinessUnitInterceptorHelper
implements QueryBuilderInterceptor
QueryBuilderInterceptor
which makes sure that only results which belong to the current
business unit are found.-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.persist.core.api.hibernate.query.QueryBuilderInterceptor
QueryBuilderInterceptor.QueryBuilderSituation, QueryBuilderInterceptor.QueryBuilderType, QueryBuilderInterceptor.SelectionInterceptor
-
Field Summary
Fields inherited from class ch.tocco.nice2.businessunit.impl.intercept.BusinessUnitInterceptorHelper
businessUnitManager
-
Constructor Summary
ConstructorDescriptionBusinessUnitQueryBuilderInterceptor
(NiceDataModel dataModel, BusinessUnitManager businessUnitManager, TypeManager typeManager) -
Method Summary
Modifier and TypeMethodDescriptionbuildConditionFor
(Class<T> modelClass, boolean isInsecure, QueryBuilderInterceptor.QueryBuilderType queryBuilderType, QueryBuilderInterceptor.QueryBuilderSituation queryBuilderSituation) createSelectionInterceptor
(EntityModel root, String basePath, List<Path> fields) Called for each 'base path' (a path without a field) that is selected inCriteriaQueryBuilder
query that uses a custom selection.void
setInterceptJoins
(boolean interceptJoins) Methods inherited from class ch.tocco.nice2.businessunit.impl.intercept.BusinessUnitInterceptorHelper
requiresBusinessUnitHandling
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.hibernate.query.QueryBuilderInterceptor
fieldUsedInQueryCondition
-
Constructor Details
-
BusinessUnitQueryBuilderInterceptor
public BusinessUnitQueryBuilderInterceptor(NiceDataModel dataModel, @Lazy BusinessUnitManager businessUnitManager, TypeManager typeManager)
-
-
Method Details
-
setInterceptJoins
@Value("${businessunit.interceptor.enableOnJoins}") public void setInterceptJoins(boolean interceptJoins) -
buildConditionFor
public <T> List<Node> buildConditionFor(Class<T> modelClass, boolean isInsecure, QueryBuilderInterceptor.QueryBuilderType queryBuilderType, QueryBuilderInterceptor.QueryBuilderSituation queryBuilderSituation) - Specified by:
buildConditionFor
in interfaceQueryBuilderInterceptor
-
createSelectionInterceptor
@Nullable public @Nullable QueryBuilderInterceptor.SelectionInterceptor createSelectionInterceptor(EntityModel root, String basePath, List<Path> fields) Description copied from interface:QueryBuilderInterceptor
Called for each 'base path' (a path without a field) that is selected inCriteriaQueryBuilder
query that uses a custom selection. The returned interceptor may add additional query paths and inspect / modify the results.- Specified by:
createSelectionInterceptor
in interfaceQueryBuilderInterceptor
- Returns:
- the
QueryBuilderInterceptor.SelectionInterceptor
that should be applied or null
-