-->
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.  [ 5 posts ] 
Author Message
 Post subject: Sort not possible with computed column
PostPosted: Tue Nov 25, 2003 1:18 pm 
At *first* view, it seems that it is not possible to sort on a "computed" column (i.e. a property with a formula).

It throws:
net.sf.hibernate.QueryException: unresolved property: ....

Why is Hibernate able to handle computed columns in SELECT clauses but not in ORDER BY clauses - (SQLally speaking it is well possible) ?
Is there a particular reason (perhaps not all DBMS are supporting functions in ORDER BY clauses) ?


Top
  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 10:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
It is an existing feature request to support formula properties in WHERE or ORDER BY clauses. Its not very hard - I just havn't got up to it yet.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 6:14 pm 
Newbie

Joined: Mon Feb 02, 2004 5:35 pm
Posts: 2
gavin wrote:
It is an existing feature request to support formula properties in WHERE or ORDER BY clauses. Its not very hard - I just havn't got up to it yet.


Have you been able to implement this yet? I have an immediate need to sort on a computed column using a date field.

-Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 5:35 am 
This feature is avalaible since version 2.1:

Excerpt fom changelog.txt:

Code:
Changes in version 2.1 rc1 (29.11.2003)
---------------------------------------
* formula properties may now be used anywhere in queries



(see http://cvs.sourceforge.net/viewcvs.py/*checkout*/hibernate/Hibernate2/changelog.txt?rev=1.41.2.36 for more details)


Top
  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 2:13 pm 
Newbie

Joined: Mon Feb 02, 2004 5:35 pm
Posts: 2
Thanks....I was just informed that we're on 2.0 so I guess I'll have to wait and see IF they plan on updating.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.