Hibernate version:
3.1
i want to select the "root entity", some properties and some projection (avg/min/max) values trough the Criteria API (query is constructed at runtime so Criteria would be more convenient).
i can do folowing:
Code:
session.createCriteria(Car.class)
.setProection(Projections.projectionList()
.add(Projection.property("owner"))
.add(Projections.max(price)))
....
and would get a List of Arrays where index 0 is a Person.class and index 1 is a Double.
but now i need to get the Car, the Owner plus the max of the price. can i do this with the Criteria API ? or do i need to use HQL (i think select c, o, max(c.price) from Car c join fetch c.owner as o..... should do the trick)
thanks for your help