Hibernate Generic D.A.O. Framework是一个基于Hibernate实现,可扩展的通用泛型DAO框架。封装了一些常用的CRUD操作和搜索功能,并提供远程服务接口。
示例代码:
Search search = new Search(); search.addFilterEqual(“name”, “hibernate-generic-dao”);
List list = projectDAO.search(search);
int count = projectDAO.count(search);
SearchResult result = projectDAO.searchAndCount(search); list = result.getResult(); count = result.getTotalCount();
search.clear(); search.addField(“rating”, Field.OP_AVG); int avgProjectRating = (Integer) prjoectDAO.searchUnique(search);