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