-->
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: Why does the runtime criteria alters the detached crteria ?
PostPosted: Mon Apr 04, 2005 10:48 am 
Newbie

Joined: Mon Mar 07, 2005 7:52 am
Posts: 4
Suppose the user wants to use a DetachedCriteria to perform multiple queries (sligtly different) usign the executable criteria.

in this example:

Code:
DetachedCriteria dc = DetachedCriteria.fromClass(someclass);

// first use
Criteria c = dc.getExecutableCrietria(sess);
c.add(somerestrictions);
c.list();

// later, second use
Criteria c = dc.getExecutableCriteria(sess);
c.add(someotherrestrictions);
c.list();



The problem is that at the end of the first use the detached criteria is changed and alters the second use havign already added somerestricitons from first use. Why does the runtime criteria alters the detached crteria ?

Regards,

_________________
edif


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 11:50 am 
Newbie

Joined: Thu Mar 23, 2006 10:52 am
Posts: 4
Actually, the second Criteria is the same object as the first, if "sess" is still the same Session.

http://opensource.atlassian.com/project ... se/HHH-635

You've probably found a work-around since you posted, but now you know you're not alone in wanting/expecting DetachedCriteria to work that way.


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.