Hi,
I found a strange phenomenom when performing an order by on String values.
I fire this statement:
Quote:
getSession().createQuery(
"from RMT_DropDown where dropDownName= :name order by item").setString(
"name", name).list();
On Windows I get back a well-ordered result A-Z - so this works.
On Solaris however I get back a result which is sorted by upper-case letters first and then lower case.
Example:
Amsterdam
Munich
Zurich
amsterdam
munich
zurich
Both are running on the same Jboss 4.2.2 instance (Java 1.5).
Any ideas why this happens? I can circument this problem by changing the HQL-Statement to "from RMT_DropDown where dropDownName= :name order by lower(item)". But I dont understand why this happens? The ordering is done by the database and not by Hibernate...
Regards,
Thomas
Hibernate version: 3.2.4.sp1
Name and version of the database you are using: Oracle 9i
The generated SQL (show_sql=true):
Code:
select
rmt_dropdo0_.dropDownID as dropDownID73_,
rmt_dropdo0_.dropDownName as dropDown2_73_,
rmt_dropdo0_.item as item73_,
rmt_dropdo0_.value as value73_
from
RMT_DropDown rmt_dropdo0_
where
rmt_dropdo0_.dropDownName=?
order by
lower(rmt_dropdo0_.item)
Code: