Build a criteria.
add order to the criteria
the order field should be one with only private getters and setters
an exception is thrown saying that there is no such method in the object
I am applying a patch that fixes this issue
The patch i attached contains some bugs:
it will be good only for methods declared in the object itself and not any method that belong to super class
i am attaching a patch to the patch that should resolve this issue.
it runs in a loop on the object and all the super hierarchy until the method is found.
in cases were the method is not found a NoSuchMethodException will be created and thrown.
see my comment above
Thanks to Aviad for the patch!