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: Query By Example and Or Logic
PostPosted: Fri Oct 29, 2004 2:26 pm 
Newbie

Joined: Thu Oct 28, 2004 10:20 pm
Posts: 1
Here's my code:


Example exampleClient = Example.create( client )
.ignoreCase()
.enableLike( MatchMode.ANYWHERE );

If client.firstName has a value for 'Frank' and client.lastName has a value of 'Tyler' the resulting where clause generated by Hibernate is something like this:

where (lower(this_1_.firstName) like ? and lower(this_1_.lastName) like ?) limit ?

I would like a way to have the where clause generated as

where (lower(this_1_.firstName) like ? or lower(this_1_.lastName) like ?) limit ?

I can't figure out based on the reference documentation, the api documentation, or even Hibernate In Action as to how I can accomplish this using QBE. Any ideas?

Thanks in advanced..


Hibernate 2.1.6
MySQL


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 03, 2004 12:13 pm 
Beginner
Beginner

Joined: Fri Mar 26, 2004 8:19 am
Posts: 49
use Disjunction.add(Expression).add(Expression)


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.