Hi, I think you will need to provide a simple, reproducible test case. That would be a SQL script, as it doesn't seem to be related to Hibernate. And please make the test case as simple as possible, meaning remove _all_ columns that are not relevant to reproduce the problem.
Regards, Thomas On Fri, Nov 1, 2013 at 3:46 PM, Dominik Moštěk <[email protected]>wrote: > Hi, > > we are using H2 (1.3.170) as an testing database with our Spring and > Hibernate (4.1.9.Final) setup. > These two sql queries are generated by the hibernate when i try to quere > the users. > > select user0_.USR_ID as USR1_10_0_, permits1_.perm_id as perm1_8_1_, > role2_.ROLE_ID as ROLE1_11_2_, user0_.USR_EMAIL as USR2_10_0_, > user0_.USR_ENABLED as USR3_10_0_, user0_.USR_LANG as USR4_10_0_, > user0_.USR_LAST_LOGIN as USR5_10_0_, user0_.USR_NAME as USR6_10_0_, > user0_.USR_PASSWORD as USR7_10_0_, user0_.USR_PHONE as USR8_10_0_, > user0_.USR_UID as USR9_10_0_, permits1_.ALL_BU as ALL2_8_1_, > permits1_.ALL_CUST as ALL3_8_1_, permits1_.ALL_GROUPS as ALL4_8_1_, > permits1_.ROLE_ID as ROLE5_8_1_, permits1_.USR_ID as USR6_8_1_, > permits1_.USR_ID as USR6_10_0__, permits1_.perm_id as perm1_8_0__, > role2_.ROLE_KEY as ROLE2_11_2_, role2_.ROLE_NAME as ROLE3_11_2_ from USERS > user0_ left outer join PERMITS permits1_ on user0_.USR_ID=permits1_.USR_ID > left outer join ROLES role2_ on permits1_.ROLE_ID=role2_.ROLE_ID where > lower(user0_.USR_ENABLED)=1 order by user0_.USR_UID desc, permits1_.ROLE_ID > asc; > > select user0_.USR_ID as USR1_10_0_, permits1_.perm_id as perm1_8_1_, > role2_.ROLE_ID as ROLE1_11_2_, user0_.USR_EMAIL as USR2_10_0_, > user0_.USR_ENABLED as USR3_10_0_, user0_.USR_LANG as USR4_10_0_, > user0_.USR_LAST_LOGIN as USR5_10_0_, user0_.USR_NAME as USR6_10_0_, > user0_.USR_PASSWORD as USR7_10_0_, user0_.USR_PHONE as USR8_10_0_, > user0_.USR_UID as USR9_10_0_, permits1_.ALL_BU as ALL2_8_1_, > permits1_.ALL_CUST as ALL3_8_1_, permits1_.ALL_GROUPS as ALL4_8_1_, > permits1_.ROLE_ID as ROLE5_8_1_, permits1_.USR_ID as USR6_8_1_, > permits1_.USR_ID as USR6_10_0__, permits1_.perm_id as perm1_8_0__, > role2_.ROLE_KEY as ROLE2_11_2_, role2_.ROLE_NAME as ROLE3_11_2_ from USERS > user0_ left outer join PERMITS permits1_ on user0_.USR_ID=permits1_.USR_ID > left outer join ROLES role2_ on permits1_.ROLE_ID=role2_.ROLE_ID where > lower(user0_.USR_ENABLED)=1 order by user0_.USR_UID asc, permits1_.ROLE_ID > asc; > > > Only difference here is in order by clause > order by user0_.USR_UID desc, permits1_.ROLE_ID asc; > order by user0_.USR_UID asc, permits1_.ROLE_ID asc; > > When i execute these queries on the oracle database, results are ordered > as expected (also when executed in production code). When loaded in test > (with h2 database) i get same results with both queries. > Did i run into some bug, or is there somethong wrong woth the query? > If you need anu further information about the setup or environemnt let me > know. > > Thanks in advance. > Dominik Mostek > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/h2-database. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
