As you can see, i'm ordering by classId atm, but what i really need is ordering by className. Of course, i can't put that instead of classId in Teacher.hbm.xml because join table doesn't have className.
One of the solutions would be to order returned set, but i'm looking for more elegant solution, to order directly in Hibernate. I googled, but didn't find anything appropriate.
What do you think?