I have 3 entity that have a relation to each other. My entities are:
- OPTION
- PLAN
- PRICE
Relationships:
- PLAN and OPTION have a many-to-many relationship
- Map of PLAN and OPTION has a many-to-many relation with PRICE
any plan has some options. an option of one plan has some price.
My possible solutions:
- I can create an
PLAN_OPTION_MAP
table and then map it withPRICE
and createPLAN_OPTION_MAP_PRICE_MAP
table. - I can create an
PLAN_OPTION_PRICE_MAP
table with id of all 3 tables that primary key is made by composite of them
Which is the better solution?