-->
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: Equal OR
PostPosted: Wed Sep 28, 2005 12:18 pm 
Beginner
Beginner

Joined: Thu Jul 28, 2005 1:19 pm
Posts: 24
Hello

I have a question about Criteria.add(expression.or

What I am trying to do is to dynamically add OR expression, for example: I have a string array that contains some string values, lets say names, now I want to select * where name=array[i];

I do Criteria cr=somethings;

for(int i;i<length;i++)
cr.add(expression("names",array[i]));

This will translate into name=array[0] AND name=array[1] AND....

How can I do the OR thing. Again I looked at expression.or but I don't know how to use it. The API states that you expression.eq(expression.or("name","smith"),expression.or("name","john"))

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 3:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i think this is better asked in the user forum

_________________
Max
Don't forget to rate


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.