white knight

导航

 
Subquery<A> subquery = criteriaQuery.subquery(A.class);
Root<A> root1 = subquery.from(A.class);

subquery = subquery.select(root1.get("attrx"));
subquery = subquery.where(criteriaBuilder.and(
criteriaBuilder.equal(root1.get("attr1"), root.get("attr11")),
criteriaBuilder.equal(root1.get("attr2"), "value")
));

criteriaBuilder.exists(subquery)
posted on 2018-04-08 13:24  white knight  阅读(722)  评论(0编辑  收藏  举报