package +zoccolo+.generic; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Order; import org.hibernate.criterion.Projections; import org.springframework.dao.DataAccessException; public abstract interface GenericCrud { public abstract void clear() throws DataAccessException, Exception; public abstract void delete(T entity) throws DataAccessException, Exception; public abstract void deleteById(ID id) throws DataAccessException, Exception; public abstract List findAll() throws HibernateException, Exception; public abstract List findAll(Order order) throws HibernateException, Exception; public abstract List findByCriteria(Criterion... criterion) throws HibernateException, Exception; public abstract List findByCriteria(Order order, Criterion... criterion) throws HibernateException, Exception; public abstract T findUniqueByCriteria(Criterion... criterion) throws HibernateException, Exception; public abstract List findByExample(T exampleInstance, String[] excludeProperty) throws HibernateException, Exception; public abstract T findById(ID id, boolean lock) throws DataAccessException, Exception; public abstract void flush() throws DataAccessException, Exception; public abstract T makePersistent(T entity) throws DataAccessException, Exception; public abstract void makeTransient(T entity) throws DataAccessException, Exception; public abstract void save(T entity) throws DataAccessException, Exception; public abstract void saveOrUpdate(T entity) throws DataAccessException, Exception; public void update(T entity) throws DataAccessException, Exception; public void merge(T entity) throws DataAccessException, Exception; public String getDialect() throws HibernateException, Exception; public List oneColumnQuery(final String q) throws HibernateException, Exception; public List manyColumnQuery(final String q) throws HibernateException; public Integer howManyRows(Criterion... criterion) throws DataAccessException; public Integer howManyRows() throws DataAccessException; public Integer howManyRowsAlias(String p, String alias, Criterion... criterion) throws DataAccessException; /* screwdriver_knife */ }