Hibernate version:
3.1.2
Hi.
I've been reading about the Criteria API but can't quite figure out how to order results on a property of an associated entity. I want something like this:
Code:
Criteria criteria = session.createCriteria(User.class);
criteria.addOrder(Order.asc("category.name"));
("category" is a many-to-one association)
This results in a QueryException "could not resolve property: category.name". I tried to add Fetchmode.EAGER for the "category" property but that didn't make any difference. Help?