package com.fp.armas.portal.dao.general; import java.io.Serializable; import com.fp.armas.portal.util.RegistroException; /** * Dao general que contienen metodos generales de acceso a datos * @author dcruz * * @param entidad de la cual se generará el DAO */ public interface GenericDao { /** * Persiste una entidad * @param entity * @throws RegistroException */ void create(T entity) throws RegistroException; /** * Actualiza una entidad * @param entity * @throws RegistroException */ void update(T entity) throws RegistroException; /** * Elimina una entidad * @param entity * @throws RegistroException */ void delete(T entity) throws RegistroException; /** * Pasa a estado detached la entidad * @param entity * @throws RegistroException */ void detach(T entity) throws RegistroException; /** * Obtiene la entidad actual de la base * @param entity * @throws RegistroException */ void refresh(T entity) throws RegistroException; /** * Busca una entidad por id * @param id * @return * @throws RegistroException */ T buscarPorId(Serializable id) throws RegistroException; }