* INTERNAL:
* Initialize delete all query. This query is used to delete the collection of objects from the
* target table.
*/
protected void initializeDeleteAllQuery(AbstractSession session) {
DeleteAllQuery query = (DeleteAllQuery)getDeleteAllQuery();
query.setReferenceClass(getReferenceClass());
query.setDescriptor(getReferenceDescriptor());
query.setShouldMaintainCache(false);
query.setIsInMemoryOnly(isCascadeOnDeleteSetOnDatabase());
if (query.getPartitioningPolicy() == null) {
query.setPartitioningPolicy(getPartitioningPolicy());
}
if (!hasCustomDeleteAllQuery()) {
if (getSelectionCriteria() == null) {
query.setSelectionCriteria(getDeleteAllCriteria(session));
} else {
query.setSelectionCriteria(getSelectionCriteria());
}
}
}