|
I am fairly new to Hibernate and have some questions surrounding design and implementation. A simplified description of what I would like to persist is the following: A User contains a list of Items. Each Item has a parent id pointing to a parent Item. Each Item can be related to many users (many-to-many). Each Item can have multiple parents for the same User. I have built the following tables: User (id, username, List<Item>), Item(id, name), User_Item(user_id, item_id, parent_id).
I guess my question is how to map this via hibernate mappings to get the desired relationships in the created pojos?
Any guidance would be greatly appreciated.
Geoff
|