-->
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: using joined table query
PostPosted: Wed Jun 18, 2008 10:50 pm 
Newbie

Joined: Wed Jun 18, 2008 9:17 am
Posts: 12
Hi

I am new to hibernate and had a question on join table .

I have few tables as follows:
eg.
- product
- productdetails
- testing session
- Assesment
- AssesmentTestLookup
- Test

productdetails table is used to lookup testingSessions for a particular product.

product --> productdetails ( 1 to many relationship )
productdetails --> testingsession ( 1 to many )

productdetails contains few other information apart from the lookup keys such and language value for example;

I have the following classes, and whats confusing me is the language field on the testing session which should be picked up during the join operation.


Product.java
- id
- Set<TestingSession> sessions

TestingSession.java
- id
- language
- Set<Assesment> assesments


How can i write the hibernate mapping when loading Product object it which will do the join using the productdetails table at the same time access the language value from the productdetails table and put it in the TestingSession object.

The examples i have seen using join table only uses the keys so any help will be appreciated.


Thanks in advance


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.