Class CriteriaDeleteBuilderImpl

All Implemented Interfaces:
CriteriaDeleteBuilder, QueryBuilderBase<CriteriaDeleteBuilder,CriteriaDeleteWrapper<Entity>>

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.