001package com.avaje.ebean.delegate;
002
003import com.avaje.ebean.Query;
004import com.avaje.ebean.Transaction;
005
006import javax.persistence.OptimisticLockException;
007import java.util.Collection;
008
009/**
010 * Provides an adaption for for all deletes.
011 */
012public interface InterceptDelete {
013
014  int delete(Class<?> beanType, Object id, Transaction transaction);
015
016  boolean delete(Object bean, Transaction t) throws OptimisticLockException;
017
018  int deletePermanent(Class<?> beanType, Object id);
019
020  int deletePermanent(Class<?> beanType, Object id, Transaction transaction);
021
022  int deleteAll(Collection<?> c) throws OptimisticLockException;
023
024  int deleteAll(Collection<?> c, Transaction transaction) throws OptimisticLockException;
025
026  int delete(Query<?> query, Transaction transaction) throws OptimisticLockException;
027
028  int deleteAll(Class<?> beanType, Collection<?> ids, Transaction transaction);
029
030  int deleteAllPermanent(Class<?> beanType, Collection<?> ids);
031
032  int deleteAllPermanent(Class<?> beanType, Collection<?> ids, Transaction transaction);
033
034  boolean deletePermanent(Object bean);
035
036  boolean deletePermanent(Object bean, Transaction transaction);
037
038  int deleteAllPermanent(Collection<?> beans);
039
040  int deleteAllPermanent(Collection<?> beans, Transaction transaction);
041}