Subquery<A> subquery = criteriaQuery.subquery(A.class); Root<A> root1 = subquery.from(A.class); subquery = subquery.select(root1.get("id")); subquery = subquery.where(criteriaBuilder.and( criteriaBuilder.isNotNull(root1.get("value0")), criteriaBuilder.equal(root1.get("value1"), root.get("value")), criteriaBuilder.equal(root1.get("value00").get("value01"), "aaa"))); criteriaBuilder.exists(subquery);