It’s super-nice that we can now compile HQL to criteria objects, but we don’t properly expose that to users in a nice way. I want to let people do:
CriteriaQuery<Book> cq = session.createCriteriaQuery("from Book where title like :title", Book.class);
List<Book> = session.createSelectionQuery(cq).getResultList();
An issue I need to figure out is how to get a reference to the Root<Book> in a nice way. The JPA API for this is not type-safe nor convenient (it returns a Set). Might just need to add a method to JpaCriteriaQuery. |