I have a person Long id and a String firstName;
I have a Criteria getSession().createCriteria(Person.class).addOrder(Order.asc("firstName"))
In the DB I have in the Person Table ID firstName ---------------------------------- 1 AD 2 00 3 AB Note tha 00 are 2 zeros
When I execute the criteriaI would like to have the correct result 2 00 3 AB 1 AD This is also the result on sql developer when executing the sql query generated by the hibernate criteria, it gives expected and the correct result mentioned above SELECT this_.ID AS ID0_1_, this_.firstName AS firstName0_1_ FROM person this_ ORDER BY this_.firstName ASC
But after executing the criteria in java I have the following incorrect result 3 AB 1 AD 2 00
As you can see the 00 are put at the end instead of at the begingin of the result set. I don't know what to do. In our office we are 5 developers. 2 have the correct result and 3 the incorrect result with the same code.
If anyone has an answer to my dilema please let me know. Maybe some encoding on my pc ? thanks for your replies
|