0

I have a query written in criteria api that goes like this:

CriteriaQuery<Application> query = builder.get().createQuery(Application.class).distinct(true);

Root<Application> root = query.from(Application.class);

root.fetch(Application_.answerSets, JoinType.LEFT);

I need to get Path for answerSet.createDate field, but have no idea how to achieve it. I need it to make a query for applications where answer sets are older than X days.

Lukas Novicky
  • 921
  • 1
  • 19
  • 44

1 Answers1

0

Try query.add(Restrictions.eq("answerSet.createDate", YOURVALUE)). However I am not if createQuery is the same as createCriteria.

IProblemFactory
  • 9,551
  • 8
  • 50
  • 66