Hi,
I would like to sort my address by a number of the building. This number may consist of digits and letters (letters only at the end).
I would like to sort this list using Criteria object. When I am using:
Code:
criteria.addOrder(Order.asc("address.firstNumber"));
I got:
22A, 23, 24B, 3, 31 and so on...
Of course I would like to have the list like that:
3, 22A, 23, 24B, 31...
Of course the problem is because my address.firstNumber field is a String instead of int. I can not use just an integer because this number may be for example 22A.
Is there an easy possibility to sort this list using Criteria object? The only solution of this problem which comes to my mind is to make an usual sql query and not a Criteria.
Regards,
Gandalf