-->
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: LogicalExpressions with three or Restrictions.
PostPosted: Tue Apr 20, 2010 7:18 pm 
Newbie

Joined: Mon Apr 19, 2010 6:37 pm
Posts: 2
Hi,

In my application I would like to search for person's firstName, lastName and email. I was wondering what is the preferred way of specifying criteria with more then three or restrictions as LogicalExpression.
This is what I would wanna do:
Code:
Criterion firstName = Restrictions.ilike("firstName",searchStr);
Criterion lastName = Restrictions.ilike("lastName", searchStr);
Criterion email = Restrictions.like("email", searchStr);
LogicalExpression orExp = Restrictions.or(firstName, lastName,email);

but Restrictions.or only accepts two Criterion parameters.


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.