Helo, I have a next problem:
I execute next code for geting a List of required objects:
Code:
session
.createCriteria(Manufacturer.class)
.setFetchMode("modelLines", FetchMode.JOIN)
.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)
.addOrder(Order.asc("name"))
.list();
The objects Manufacturer ordering by "name" attribute. But also I need order joined "modelLines" objects in result by "modelLines.name" attribute.
I was try to add next:
Code:
...
.addOrder(Order.asc("modelLines.name"))
...
but it's throw exception...
Code:
.... could not resolve property: modelLines.name ....
Please, answer me what I need to do. I think that my problem is very simple.
Thanks.