I'm using hibernate template and it's
findByCriteria(criteria, offset, maxResults) method
to get results paginated.
To get results ordered before calling findByCriteria
I set in criteria OrderBy property. The problem is
a want to order this column not just as simple string, but take into
account that it may contain numbers and sort it in alphanumeric way:
entity 2
entity 19
entity 22
not like this:
entity 19
entity 2
entity 22
To do this I'm using comparator it works ok with Collections.sort. But I need a way to bind it to criteria and get already ordered after firing findByCriteria method. Is there is a way to accomplish this?
Thanks!