-->
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.  [ 3 posts ] 
Author Message
 Post subject: Criteria and specific order
PostPosted: Wed Sep 21, 2005 11:38 am 
Regular
Regular

Joined: Tue Oct 07, 2003 1:13 pm
Posts: 70
Location: Paris, France
Hibernate version: 3.1b2

I'd like to know if the following order will be supported in future releases :

List l = s.createCriteria(House.class,"b")
.createAlias("b.folder","d")
.addOrder( Order.asc("d.id")); // Supported
.addOrder( Order.asc("upper(b.company)")) // NOT SUPPORTED !

Or is there any alternatives to write my query ?

Thank you for your feedback.
Richard


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 5:07 pm 
Regular
Regular

Joined: Fri Sep 09, 2005 11:35 am
Posts: 101
have you tried this ? This should work always.

List l = s.createCriteria(House.class,"b")
.addOrder( Order.asc("upper(b.company)"))
.createAlias("b.folder","d")
.addOrder( Order.asc("d.id")); // Supported


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 2:21 am 
Regular
Regular

Joined: Tue Oct 07, 2003 1:13 pm
Posts: 70
Location: Paris, France
Thank you, but I have found the solution with the following code :

List l = s.createCriteria(House.class,"b")
.createAlias("b.folder","d")
.addOrder( Order.asc("d.id")); // Supported
.addOrder( Order.asc("b.company").ignoreCase())

Thank you.
Richard


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