Reputation: 12621
I am using hibernate. i have below native sql query.
select * from some_table order by to_number(someId);
here someId column contains all numbers but datatype is of varchar type. so while pulling i need to apply order by. if order by is applied with out to_number then ASCII comparison is done. to avoid that i need to apply order by with to_number.
how can i achieve the same using criteria? i am not using annotations. using hbms.
Thanks!
Upvotes: 0
Views: 2763
Reputation: 42114
That cannot be done with Criteria API, because it does not provide conversion from string to number (of for example from varchar to integer in the end).
You can:
Upvotes: 1