당신이 할 필요가있을 것이다 :
final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
final CriteriaQuery<PayerCriteria> criteriaQuery = criteriaBuilder.createQuery(PayerCriteria.class);
final Root<PayerCriteria> root = criteriaQuery.from(PayerCriteria.class);
criteriaQuery.select(root);
final Join join = root.join("determinationRequest");
final Predicate predicate = criteriaBuilder.equal(join.get("id"), 1);
criteriaQuery.where(predicate);
final TypedQuery<PayerCriteria> query = entityManager.createQuery(criteriaQuery);
System.out.println("------------>" + query.getResultList());
쉽게 EasyCriteria (http://easycriteria.uaihebert.com)라는 이름의이 부담을하게하는 프레임 워크가있다. 위의 기준은 다음과 같습니다 :
EasyCriteria<RegularEntityOne> easyCriteria = EasyCriteriaFactory.createQueryCriteria(entityManager, RegularEntityOne.class);
easyCriteria.innerJoin("regularEntityTwo");
easyCriteria.andEquals("regularEntityTwo.id", 1);
System.out.println("------------>" + easyCriteria.getResultList());