I have the following Tables in my database:
Person
Category
Person_Category
Category_Content
Content
A Person has a many to many relationship to Categories.
A Category has a many to many relationship to Content.
Therefore a Person has a many to many relationship to Content.
I would like to design my objects w/o creating a Category Object. I would like a collection of available Content in Person. So I want to create a mapping from Person to Content. The mapping would have to link across Person_Category and Category_Content.
Code:
person --- person_category --- category_content --- content
--------- --------------- ---------------- ----------
person_id person_id category_id content_id
category_id content_id
It's not obvious to me how to map Person to Content through the two link tables
What would be the hibernate mapping syntax to do this? Thanks in advance for any examples[list=][/list]