-->
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 do you do a Many Table Join, please help !
PostPosted: Wed Oct 04, 2006 11:21 am 
Beginner
Beginner

Joined: Wed Sep 13, 2006 7:24 am
Posts: 26
Hibernate version: 3.1

I am trying to create a query and it seems the API is not playing Ball.

i have a table schema

Code:
(SystemEvent) Links (Feed) Links (FeedBusinessMapping) Links (Business)



    All query in brackets are tables
    Feed has a 1 to none/many link to FeedBusinessMapping
    Business has a 1 to none/many link to FeedBusinessMapping
    SystemEvent has a 1 to 1 link to Feeds
    FeedBusinessMapping has a composite key (feedid,businessid)


Now the with the follwing code i am trying to do a join

i've tried the below code,

Code:
Session session = HibernateSessionFactory.currentSession();
        List results1 = session.createCriteria(SystemEvent.class)
        .setFetchMode("feed", FetchMode.JOIN)
        .setFetchMode("feed.feedBusinessMappingSet.business",FetchMode.JOIN)
        .list();


and the sql generated only joins SystemEvent and Feeds

i even attempted
Code:
Session session = HibernateSessionFactory.currentSession();
        List results1 = session.createCriteria(SystemEvent.class)
        .setFetchMode("feed", FetchMode.JOIN)
        .setFetchMode("feed.feedBusinessMappingSet.id.business",FetchMode.JOIN)
        .list();


which still doesn't work

has anyone got a suggestion ?

_________________
Ben


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.