Hibernate version: 3.2
Name and version of the database you are using: MS SQL Server 2000 SP4
Hi,
does anyone know how I would mimic an ORDER BY CONVERT(int, field) statement using the Hibernate criteria interface?
I have a lookup table with codes and descriptions such as:
Code Description
1 Desc 1
2 Desc 2
10 Desc 10
Both fields are strings so when a query runs to retrieve data from the table it's done so alphanumerically instead of numerically so results are 1, 10, 2.
Using the CONVERT(int, Code) I can get 1, 2, 10.
Is there any way of doing this or will i have to create a named query in the mapping file to support the ORDER BY?
Thanks,
John
|