-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Order by problem in HQL
PostPosted: Mon Mar 29, 2004 6:34 am 
Newbie

Joined: Wed Aug 27, 2003 5:31 am
Posts: 10
Hi, Hibernate gurus
I have problem of order by clase in HQL.
It seems the following HQL dosen't work:
Code:
select a from com.erry.model.sales.SalesCheckoutBill as a where ... order by a.client.code
It translates to sql statment like :
Code:
  select a.ID, a.code,..._clt.ID from T_CHK_OUT_BILL a, T_CLIENT _clt.ID ... order by _clt.CODE
whose select clause doesn't contain the order by column.
And the result is not what we want, it doesn't order properly.

But, if I include the order by column in HQL like:
select a from com.erry.model.sales.SalesCheckoutBill as a, a.client.code where ... order by a.client.code
it works!

What's wrong? Any workaround?

Regards,
Justin


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 29, 2004 7:35 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I think Gavin wanted to to something about that.
You can probably do something like
Code:
select myObb, o.myCode, ... order by o.myCode

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.