Reputation: 374
How to mapping the relations between three class @ManyToMany unidirectional for a unique table ?
The relations is like that:
So, when I'll create a Project, I'll chose somes Tasks and somes Task's Activitys.
I would to create a table (project_task_activity_map) like that:
project_id task_id activity_id
1 2 3
1 2 4
2 1 2
2 1 1
2 2 3
2 3 5
How can I map the class Project ?
Reference link:
Upvotes: 1
Views: 178
Reputation: 3416
I think hierarchy like
Project | Task | Activity
There is no direct relation between Project & Activity.
Better to create many to many table for Task & Activity, keep Project as master only. Total 4 tables - Project - Task - Activity - TaskActivityMapping
Fourth table will be created by Hibernate mapping of Task and Activity via Embadable.
Upvotes: 1