58 lines
1.2 KiB
Plaintext
Executable File
58 lines
1.2 KiB
Plaintext
Executable File
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 <T> entidad de la cual se generará el DAO
|
|
*/
|
|
public interface GenericDao<T extends Serializable> {
|
|
|
|
/**
|
|
* 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;
|
|
}
|