-->
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: Session Find One to Many to Many
PostPosted: Thu Dec 11, 2003 3:47 am 
Newbie

Joined: Wed Oct 01, 2003 8:56 am
Posts: 6
Hi All

I am looking for help with the following scenario.

I have 3 tables

Consumer --> Brand -- > Campaign

I would like to return Consumer, for firstName, lastName and DateOfBirth,
and Brands, for brandName
and Campaigns for campaignCode.

The Result from my query must be Consumer, i.e

From Consumer con
where con.firstName = ?
and con.lastName = ?
and con.dateOfBirth = ?
and con.brand.name =?
and con.brand.campains.campaignCode = ?

The Consumer must always be returned if the firstName, lastName, dateOfBirth matches, otherwise nothing must be returned.
All brands that match brandName must be contained in the Consumer
All Campaigns that match campaignCode must be contained in the Consumer.Brand.

Any help would be appreciated
Thanks in advance
Jeff Singer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2003 3:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use an explicit JOIN to the collection. This is a FAQ.


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.