aggregate « Criteria « JPA Q&A





1. constraining a criteria on an aggregation    forum.hibernate.org

Hi all, I've been trying to express this query using the criteria api, without much luck so far. Help will be very appreciated. Model: one Patient has many Visits and a Visit belongs to a Patient. The HQL query: select p from Patient p join p.visits v group by p having max(v.startDateTime) >= :date 1st try ( see 16.7. Projections, aggregation ...