`

Hibernate hql语句

 
阅读更多

 

在Aciton中直接进行数据库的操作。

--删除HibernateUtils.deleteAll(this.contentLogicInterface.getSession(),"hql");

--查找 HibernateUtils.findAll(getSession(), "hql");

在DAO中运行hql语句。

返回int类型为数据库执行操作的条数。

返回查询的结果集。

String hql="selectcount(*)  from BookMark fbm wherefbm.userId="+userTel+"";
       Query query=getSession().createQuery(hql);
       int count=((Number)query.iterate().next()).intValue();
       return count;
返回count(*)
 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics