-->
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: many to many relationship and filtered collection
PostPosted: Wed Sep 26, 2012 8:14 am 
Newbie

Joined: Thu Aug 20, 2009 4:22 am
Posts: 7
Hi,
I've tried to work this out but keep running into a brick wall, hopefully am not missing something obvious.

I've got a many to many relationship between Employer and Employee set up no problem using a join table called employer_employee with foreign keys of 'employer_id' and 'employee_id'. This returns lists of employees associated with employers and vice versa

I aso have a table called employee_performance which has foreign keys of 'employer_id' and 'employee_id' and additional columns of 'test_date' and 'score'.

How do I set up a relationship between employer/employee and this employee_performance table so that I only bring back the employee performance rows related to the employer and employee

for example
employer returns a list of employees and each employee return a list of performance results for that employer/employee combination?

I can create a mapping between employee and employee_performance but I'm not sure how to feed in the employer ID so I can filter out records.

Thanks in advance for any help

Euan


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.