Class CriteriaDeleteBuilderImpl
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.QueryBuilderBaseImpl<CriteriaDeleteBuilder,CriteriaDeleteWrapper<Entity>>
ch.tocco.nice2.persist.core.impl.hibernate.query.AbstractCriteriaBuilder<CriteriaDeleteBuilder,Serializable,CriteriaDeleteWrapper<Entity>>
ch.tocco.nice2.persist.core.impl.hibernate.query.CriteriaDeleteBuilderImpl
- All Implemented Interfaces:
CriteriaDeleteBuilder
,QueryBuilderBase<CriteriaDeleteBuilder,
CriteriaDeleteWrapper<Entity>>
public class CriteriaDeleteBuilderImpl
extends AbstractCriteriaBuilder<CriteriaDeleteBuilder,Serializable,CriteriaDeleteWrapper<Entity>>
implements CriteriaDeleteBuilder
Creates a query for the primary key (using the delete security conditions) and creates a proxy
for each result (using
Session.load(Object, Serializable)
). This important as the
entities should only be loaded from the database when they are actually required by a listener.
The proxies are then scheduled for deletion with the EntityTransactionContext
.
All entities will be deleted with a single statement when the transaction is committed.
Because this bypasses the normal delete process we need to manually fire the
EntityFacadeListener.entityDeleting(EntityFacadeEvent)
event.-
Field Summary
Fields inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.AbstractCriteriaBuilder
criteriaBuilder, jdbcFunctions, parameterProviders, parameters, predicateFactory, query, queryRoot, session, subqueryFactory
Fields inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.QueryBuilderBaseImpl
collector, conditionFactory, dataModel, fieldResolver, insecureEnabled, interceptors, predicates, queryHints, typeManager
-
Constructor Summary
ConstructorDescriptionCriteriaDeleteBuilderImpl
(org.hibernate.Session session, Class<? extends Entity> entityClass, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, TypeManager typeManager, EntityTransactionContext entityTransactionContext, EntityFacadeListenerManager entityFacadeListenerManager, List<QueryBuilderInterceptor> interceptors, Map<String, JdbcFunction> jdbcFunctions, Map<String, ParameterProvider<?>> parameterProviders, InsecureOrderPathsRegistry insecureOrderPathsRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected CriteriaDeleteWrapper
<Entity> doBuild()
protected QueryBuilderInterceptor.QueryBuilderType
protected CriteriaDeleteBuilderImpl
self()
Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.AbstractCriteriaBuilder
addParameter, applyParametersToQuery, createQuery, getCriteriaBuilder, getPredicateFactory, getQueryDistinctStrategy, getQueryRoot, getSubqueryFactory, logNewQueryError
Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.QueryBuilderBaseImpl
build, doInsecure, getPredicates, initializationCompleted, where, where, where, where, whereInsecure, whereInsecure, whereInsecure
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.builder.QueryBuilderBase
addParameter, build, getCriteriaBuilder, getPredicates, getQueryRoot, getSubqueryFactory, where, where, where, where, whereInsecure, whereInsecure, whereInsecure
-
Constructor Details
-
CriteriaDeleteBuilderImpl
public CriteriaDeleteBuilderImpl(org.hibernate.Session session, Class<? extends Entity> entityClass, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, TypeManager typeManager, EntityTransactionContext entityTransactionContext, EntityFacadeListenerManager entityFacadeListenerManager, List<QueryBuilderInterceptor> interceptors, Map<String, JdbcFunction> jdbcFunctions, Map<String, ParameterProvider<?>> parameterProviders, InsecureOrderPathsRegistry insecureOrderPathsRegistry)
-
-
Method Details
-
getPermission
- Specified by:
getPermission
in classQueryBuilderBaseImpl<CriteriaDeleteBuilder,
CriteriaDeleteWrapper<Entity>>
-
doBuild
- Specified by:
doBuild
in classQueryBuilderBaseImpl<CriteriaDeleteBuilder,
CriteriaDeleteWrapper<Entity>>
-
self
- Specified by:
self
in classQueryBuilderBaseImpl<CriteriaDeleteBuilder,
CriteriaDeleteWrapper<Entity>>
-