java学习

java学习

 

hibernate里的DetachedCriteria的几种条件查询方法

detachedCriteria.add(Restrictions.eq("user.userId", userId));
Restrictions.eq()是等于,Restrictions.allMap()使用Map,使用key和value进行多个等于的对比
Restrictions.gt()大于,Restrictions.ge()大于等于,Restrictions.lt()小于,
Restrictions.le()小于等于,Restrictions.between()对应sql中的between字句,
Restrictions.like()对应sql的like字句,
Restrictions.in()对应sql的in字句
Restrictions.and()
Restrictions.or()
Restrictions.sqlRestnction(),是对sql限定查询 

posted on 2012-09-27 13:35 杨军威 阅读(707) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜