jamesyreid wrote:
However, for some reason, certain symbols are appearing at the END of my results. So my list of results looks something like this...
"
$
%
1
2
9
A
B
C
Z
/
£
Does anyone know why my ordering is returning symbols such as $ and % at the start of my list of results, while symbols like / and £ appear at the end of my list of results?
I think this is not an Hibernate issue, if to be considered as an issue. You should use the SQL logged in your console to test it under SQLPlus or any other SQL Client. I guess you'll have the same order as you saw.
When you put addOrder() like you did, you just ask Hibernate to add an "order by" clause to the generated SQL Query, then Hibernate processes the answer in the order it comes back.
So, the order you're finding quite abnormal is certainly the default one for Oracle, that's all :-).
jamesyreid wrote:
Is is possible to specify how symbols are ordered using Hibernate???
I don't if it's possible with Hibernate, but you could write a simple Java comparator that would do the sorting you want on the retrieved list. Something like :
Code:
Query q = session.createQuery(...);
List result = Collections.sort(q.list(), new YourComparator());