daoImpl实现的方法: public News nextPage(News news){try{String queryString=from News d where d.id? order by id desc;Q【本文来自鸿网互联 (http://www.68idc.cn)】uery queryObject=getSession().createQuery(queryString);queryObject.setLong(0,new
daoImpl实现的方法:
public News nextPage(News news){ try{ String queryString="from News d where d.id order by id desc"; Q【本文来自鸿网互联 (http://www.68idc.cn)】uery queryObject=getSession().createQuery(queryString); queryObject.setLong(0,news.getId()); queryObject.setFirstResult(0); queryObject.setMaxResults(1);public News nextPage(News news) { try { String queryString = "from News d where d.id>? order by id asc"; Query queryObject = getSession().createQuery(queryString); queryObject.setLong(0,news.getId()); queryObject.setFirstResult(0); queryObject.setMaxResults(1); return (News)queryObject.list().get(0); } catch (RuntimeException re) { throw re; } } return (News)queryObject.list().get(0);}catch(RuntimeException re){throw re;}}
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com