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 ?