首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

hibernate查询记要总数量

2012-10-27 
hibernate查询记录总数量String hql select count(*) from Presc p + where p.operType ? and (tru

hibernate查询记录总数量

String hql = "select count(*) from Presc p "        + "where p.operType = ? and (trunc(p.orderDate) between ? and ?)";Query query = getSession().createQuery(hql);query.setString(0, prescTypeCode);query.setDate(1, startDate);query.setDate(2, endDate);Integer count = (Integer) query.uniqueResult();

热点排行