Reputation: 31548
I have four classes
User profile
will have many to many
with Activities
so there will be profile_activities
table with profile_id
and activity_id
Now User will do 1 workbook per activity per profile
so i am confused how to map in database
Upvotes: 0
Views: 66
Reputation: 7272
I've revised my suggestion in light of your comment.
Perhaps could have an UserActivity class which has an Activity property and a Workbook property.
Then you can have a User class with a property that is a list of Profile classes, and the Profile class will have a property that is a list of UserActivity classes.
This satisfies your object model.
So the UserActivity table will have a foreign key to a row in the Profile table (which will be its parent ID), and foreign keys to the Activity and Workbook tables.
Your Profile table has a foreign key to a row in the User table which is its parentID.
Upvotes: 1