-->
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.  [ 1 post ] 
Author Message
 Post subject: Reusing the criteria for two different orderings
PostPosted: Tue Dec 20, 2005 6:44 am 
Newbie

Joined: Fri Nov 04, 2005 4:47 am
Posts: 14
Hibernate version:
3

I need to reuse a criteria object twice. The first is used to generate an Excel dump, while the second is used to display data to the user. The first has a fixed ordering, so I need to call addOrder() on the criteria object with the ordering I want. But for the query that will display data to the user, the ordering is set by the user.

I can of course clone the Criteria object using serialization and all that, but it seems like an extremely clumsy way of doing it. Instead I would just like to take the Criteria instance, do addOrder("the Excel ordering"), do list(), then do something like deleteOrder("the Excel ordering"). The code handling user ordering will then follow and add ordering depending on user input.

Any good ideas?


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

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.