摘要: publicinterfaceMemberDao{//省略了其他的代码/***//***分页查询*@paramhql查询的条件*@paramoffset开始记录*@paramlength一次查询几条记录*@return*/publicListqueryForPage(finalStringhql,finalintoffset,finalintlength);/***//***查询所有记录数*@paramhql查询的条件*@return总记录数*/publicintgetAllRowCount(Stringhql);}2、DAO层实现类MemberDaoImpl对上面两个方法的实现如下:publ 阅读全文
posted @ 2012-12-20 21:27 月亮之城 阅读(286) 评论(0) 推荐(0) 编辑
摘要: Page.javaJava代码 importjava.util.List;/***分页Page类*@authorzhxing**@param<T>*/publicclassPage<T>{publicfinalintDEFAULT_PAGESIZE=10;//每页记录数privateList<T>result=null;//页面数据privateinttotalRows;//总记录数privateintpageSize=DEFAULT_PAGESIZE;//每页显示行数privateintcurrentPage;//当前页数privateinttotalPa 阅读全文
posted @ 2012-12-20 20:38 月亮之城 阅读(345) 评论(0) 推荐(0) 编辑
摘要: package sanitation.dao;import java.util.List;/** * * @param <T> */public interface GenericDAO <T>{ /** * 通过ID获得实体对象 * * @param id实体对象的标识符 * @return 该主键值对应的实体对象 */ T findById(int id); /** * 将实体对象持久化 * * @param entity 需要进行持久化操作的实体对象 * @return 持久化的实体对象... 阅读全文
posted @ 2012-12-20 20:31 月亮之城 阅读(244) 评论(0) 推荐(0) 编辑
摘要: ,1, 实体类查询public List<T> findAll(Class<T> entityClass) {return super.getHibernateTemplate().loadAll(entityClass);}2, 保存指定实体类public Serializable save(T entity) {return super.getHibernateTemplate().save(entity);}3, 查找指定PK的一个实体类对象public T findEnityById(Class<T> entityClass, PK id) {ret 阅读全文
posted @ 2012-12-20 19:43 月亮之城 阅读(602) 评论(0) 推荐(0) 编辑
摘要: <TABLEstyle="BACKGROUND-POSITION: right bottom; BACKGROUND-IMAGE: url(http://www.fax998.com/cantonfair/3.jpg); BACKGROUND-REPEAT: no-repeat"cellSpacing=0 cellPadding=0 width="100%" border=0>BACKGROUND-REPEAT: no-repeat这个表示背景图片不平铺BACKGROUND-POSITION: right bottom这个表示背景图水平居右, 阅读全文
posted @ 2012-12-20 18:07 月亮之城 阅读(401) 评论(0) 推荐(0) 编辑
摘要: <!--spring配置--><?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx=" 阅读全文
posted @ 2012-12-20 16:59 月亮之城 阅读(300) 评论(0) 推荐(0) 编辑