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:
{code:java}CriteriaQuery<Book> cq = session. getFactory().getCriteriaBuilder() . createCriteriaQuery("from Book where title like :title", Book.class); //manipulate the query List<Book> = session.createSelectionQuery(cq).getResultList();{code}
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}}. |
|