Forums Register Login

Hint on how to represent jave Object with two relation tables

+Pie Number of slices to send: Send
Hi all,
I would like help/hints regarding the design of this situation:

This is a fictitious example, Say I have users in support group and teaching group, each user can be present in several groups.
Say Dave is in support group a,b,c and in teaching group x,y
tables:
users
user_identifier
support_groups
support_group_identifier
users_in_support_group
user_identifier
support_group_identifier

teaching_groups
teaching_group_identifier
users_in_teaching_group
user_identifier
teaching_group_identifier


I thought User can be abstract containing just Identifier,
And to have AssignedToSupportGroupUser, AssignedToTeachingGroupUser
AssignedToSupportGroupUser will inherit User and will include the support_group_id
Support Group object will hold List<AssignedToSupportGroupUser>

I am debating about the JAVA side design, I will appreciate some general guidelines or an example url..
Sorry for my lame English...

+Pie Number of slices to send: Send
Not sure I understand, but seems you just should have,

User
- id
- ManyToMany List<SupportGroup> supportGroups
- ManyToMany List<TeachingGroup> teachingGroups

SupportGroup
- id
- ManyToMany List<User> users

TeachingGroup
-id
- ManyToMany List<User> users
New rule: no elephants at the chess tournament. Tiny ads are still okay.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 653 times.
Similar Threads
Table Design Question
OO design
Use Case
Discussion on the various classes needed for an Application --- Anyone?
Parsing a String
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:57:46.