当我写一个 HQL 查询时
Query q = session.createQuery("SELECT cat from Cat as cat ORDER BY cat.mother.kind.value");
return q.list();
一切都很好。然而,当我写一个标准
Criteria c = session.createCriteria(Cat.class);
c.addOrder(Order.asc("mother.kind.value"));
return c.list();
我得到一个异常 org.hibernate.QueryException: could not resolve property: kind.value of: my.sample.data.entities.Cat
如果我想使用 Criteria 和 Order,我应该如何表达我的“ Order by”?