• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sorting problem with HibernateSqlQuery with Websphere

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using Hibernate sql query to query some result set from database(Oracle 10G). Sql has orderby clause in it so that result are sorted by the sql itself.

Now the sql with sorting is working fine on Jboss, Weblogic. But on websphere sorting is not working though the results are same.

Thanks in advance.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you say sounds very surprising. The container does't play any part in ordering of SQL results sets.

How do you sort your results? Can you show us the SQL you use and the code you call the query from?
 
Ranjan Shri
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Sturrock:
What you say sounds very surprising. The container does't play any part in ordering of SQL results sets.

How do you sort your results? Can you show us the SQL you use and the code you call the query from?



I have a employee table having employeeid, employee name and address as it fields.
Sql being used is select employeeid, employeename, address from emplyoee order by 2 asc

Code is pretty stright forward
SQLQuery sqlQuery = createQuery(queryString);
where queryString is above mentioned query and createQuery is a private method which gets the SQLQuery object form HibernateSessionImpl

Returned resultset is not sorted correctly in websphere
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does createQuery(queryString) do? Does it keep the column order as defined in your query? Using "order by 2" requires a fixed column order. What happens if you change this to "order by employeename", is the ordering more consistant?
reply
    Bookmark Topic Watch Topic
  • New Topic