一个公共的DAO接口
import java.io.Serializable;
import java.util.List;
/**
*@category
*@class EntityDao
*@author zhusheng3@126.com
*@date 2008-4-19 下午05:52:10
*@see
*/
public interface EntityDao<T>
{
/**
* @return find all objects
*/
List<T> findAll();
/**
* find an object by its id
* @param id
* @return an object
*/
T findByID(Serializable id);
/**
* find objects by sql(jdbc) or hql(hibernate)
* @param ql
* @param values
* @return an objects list of the query result
*/
List<T> findByQL(String ql, Object... values);
/**
* save the object input
* @param o
*/
void save(Object object);
/**
* update the object input
* @param o
*/
void update(Object object);
/**
* saveOrUpdate the object input
* @param o
*/
void saveOrUpdate(Object object);
/**
* delete the object input
* @param o
*/
void remove(Object object);
/**
* delete an object by its id
* @param id
*/
void removeById(Serializable id);
}
一个公共的DAO接口
最新推荐文章于 2018-09-27 16:16:49 发布