The SQL worked perfectly, I was stumped. Google couldn't even tell me the answer! I used the time-tested method of try everything and figure out the pattern to solve this one....
The answer was that if you are specifying the "select" clause, the attribute that you are ordering by must appear in the select list.
So, to continue with the example in the hibernate 3.3 documentation
select cat.sex from DomesticCat catis incorrect, but
order by cat.name asc, cat.weight desc, cat.birthdate
select cat.sex, cat.name, cat.weight, cat.birthdate from DomesticCat catworks.
order by cat.name asc, cat.weight desc, cat.birthdate
No comments:
Post a Comment