I have this HQL statement:
Code:
SELECT new caats.SearchSourceResultDTO(source.id, sourceName.companyName, source.county.name) FROM caats.entity.Source as source inner join source.sourceNames as sourceName 
I need to order by companyName, and county.name .  When I try to do this: 
Code:
SELECT new caats.SearchSourceResultDTO(source.id, sourceName.companyName, source.county.name) as ssrDTO FROM caats.entity.Source as source inner join source.sourceNames as sourceName ORDER BY ssrDTO.id ASC
It fails, even though I have getter "id" in that object.  How is it possible to order by a type safe object.  I got this idea from the docs where there is an example:
Code:
 or as an actual typesafe Java object
select new Family(mother, mate, offspr)
from eg.DomesticCat as mother
    join mother.mate as mate
    left join mother.kittens as offspr
Thanks in Advance,
Jacob[/code]