When I write a HQL query
Query q = session.createQuery("SELECT cat from Cat as cat ORDER BY cat.mother.kind.value"); return q.list();
Everything is fine. However, when I write the criterion
Criteria c = session.createCriteria(Cat.class); c.addOrder(Order.asc("mother.kind.value")); return c.list();
I get an org.hibernate.QueryException: could not resolve property: kind.value of: my.sample.data.entities.Cat
If I want to use criteria and order, how should I express my "order"?
java sql-order-by hibernate hql
niklassaers Nov 22 '09 at 21:55 2009-11-22 21:55
source share