hibernate Criteria子查询问题 5
怎么做才能生成sql语句select*froma,bwherea.name=1andexists(select*froma,bwherea.di=b.id)主要是这句a....
怎么做才能 生成sql语句
select * from a,b where a.name =1
and exists ( select * from a,b where a.di = b.id )
主要是这句 a.di = b.id 用Criteria怎么写 才能变成这样 展开
select * from a,b where a.name =1
and exists ( select * from a,b where a.di = b.id )
主要是这句 a.di = b.id 用Criteria怎么写 才能变成这样 展开
展开全部
建议用hibernate离线查询方式实现,如:
Criteria criteria = createCriteria(Product.class);
DetachedCriteria dc = DetachedCriteria.forClass(Specification.class,"s");
dc.add(Restrictions.le("price", price));
criteria.add(Subqueries.notExists(dc));
Criteria criteria = createCriteria(Product.class);
DetachedCriteria dc = DetachedCriteria.forClass(Specification.class,"s");
dc.add(Restrictions.le("price", price));
criteria.add(Subqueries.notExists(dc));
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询