Hi all,
I'm doing a simple SQL query with Hibernate, but if I run it in Windows I get it order like AaBbCc and if I run under Linux I get it ordered like ABCabc. The database is in a linux machine in the two test so it doesn't change.
I'm a bit confused because I thought that the DB was doing the sorting so I didn't expect to found different results, How this could happen?
I'm using Hibernate 3.5 and Oracle 11g.
My simple test:
Code:
String sql = "SELECT * FROM ENGICLIE.T_RT_RTI ORDER BY DESCR_RTI";
Query query = HibernateUtil.getSessionFactory().getCurrentSession().createSQLQuery(sql)
.addEntity("sc", TRtRti.class);
List list = query.list();
for (int i = 0 ; i<list.size(); i++) {
TRtRti r = (TRtRti)list.get(i);
System.out.println(r.getDescrRti());
}
Windows Output:
Code:
AAA_RTI_GLC1
AAA_rti_glc2
AAA_RTI_GLC3
BAL_BLA_BLA
Descrizione rti
eeweqw
GLC_TEST_INS_1
mao mao
rti con spazi
RTI GLC test finale
test GLC 3
TEST GLC 4 mod.2
testRTI
Linux output:
Code:
AAA_RTI_GLC1
AAA_RTI_GLC3
AAA_rti_glc2
BAL_BLA_BLA
Descrizione rti
GLC_TEST_INS_1
RTI GLC test finale
TEST GLC 4 mod.2
eeweqw
mao mao
rti con spazi
test GLC 3
testRTI