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: how add restriction with or using criteria API
PostPosted: Wed Aug 29, 2007 11:24 am 
Newbie

Joined: Sat Mar 03, 2007 3:14 am
Posts: 16
To criteria, restrictions is added(and other things but that does not interest right now) for example:
Criteria.add (Restriction.like (“name”, “Pepe”));
by defect when you add one restriction is reconciled through “AND”, that is to say:
Criteria.add (Restriction.like (“name”, “Pepe”));
criteria.add (Restriction.like (“last name”, “Will wash”));

here it looked for all the person who their name is PEPE and his Lavaer last name.
Also the Junction objects exist (Conjunction and Disjunction) to connect with “AND” and “OR”

When we used the Disjunction for “or” is necessary to put followed them

Criterio.add (Restriction.Disjuntcion (Restriction.ilike (something….).add (Restriction.ilike (something….)). add (Restriction.ilike (something….))))

- The question
How obtain that all the restrictions that are added to the criterion connect with “Or”. and not "and" ?


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.