-->
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: Negating a Criteria Class
PostPosted: Fri Oct 01, 2010 4:39 am 
Newbie

Joined: Tue Sep 21, 2010 12:43 pm
Posts: 6
Hi!

I have the following question:

Is there a way, to negate a Criteria object?
I mean: Get all results, except the ones returned by the given Criteria object?

Thx!


Top
 Profile  
 
 Post subject: Re: Negating a Criteria Class
PostPosted: Fri Oct 01, 2010 6:10 am 
Beginner
Beginner

Joined: Fri Mar 11, 2005 7:46 am
Posts: 29
Have a look here:

http://docs.jboss.org/hibernate/stable/ ... ssion.html


Top
 Profile  
 
 Post subject: Re: Negating a Criteria Class
PostPosted: Fri Oct 01, 2010 7:37 am 
Newbie

Joined: Tue Sep 21, 2010 12:43 pm
Posts: 6
Thanx, but I would like to negate a whole "Criteria", and not only a single "Criterion"


Top
 Profile  
 
 Post subject: Re: Negating a Criteria Class
PostPosted: Wed Mar 23, 2011 6:14 am 
Newbie

Joined: Tue Dec 21, 2010 9:43 am
Posts: 8
Did you find a workaround for that? Thanks.


Top
 Profile  
 
 Post subject: Re: Negating a Criteria Class
PostPosted: Wed Mar 23, 2011 8:49 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
I guess the theoretical correct inversion would be something like createCriteria(Object.class) and use a "not in" subcriteria, but I do not see a good reason why you should ever do that. You would fetch the whole database but the objects matching your subcriteria.

_________________
-----------------
Need advanced help? http://www.viada.eu


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.