/* * GenericDAO.java * * Created on 2 de Dezembro de 2006, 03:41 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package com.tecgraf.dao; import com.tecgraf.dao.DAOException; import java.io.Serializable; import java.sql.PreparedStatement; import java.util.List; /** * * @author ismael * Use one interface per persistent entity, with a super interface for common CRUD functionality */ public interface IGenericDAO { void getPreparedStatement(String query) throws DAOException; void closePreparedStatement() throws DAOException; T findById(ID id) throws DAOException; List findAll() throws DAOException; List findByExample(T exampleInstance) throws DAOException; T makePersistent(T entity) throws DAOException; boolean deletePersistent(T entity) throws DAOException; boolean updatePersistent(T entity) throws DAOException; }