At least for me was working using nativequery and puting the name of the table like this.
select * from employees e order by e.EmployeeCreatedDate desc, e.EmployeeName desc
ghvijayakumar wrote:
Hi,
One of my project table contains the below like columns:
EmployeeId EmployeeName EmployeeCreatedDate
1 jana 2012-12-12 00:00:00.000
2 gana 2012-12-04 00:00:00.000
I have a requirement like below:
The list should show the top 200 employees based on the EmployeeCreatedDate desc.
The output of the above top 200 employees should be in alphabetical order based on employeename.
How to achieve the above two order by's in hibernate in single query or with single Criteria or with any other mode of queries?
select * from employees order by EmployeeCreatedDate desc, EmployeeName didn't work, as usual...