Trying to setup a Entity relationship but having difficulty figuring out a relationship i need:
I have a single Entity, Person. Person has two relationships, super_friend and sub-friend. Each Entity can have many friends (a Person Entity), so sub_friend is to-many relationship. I am not sure what super_friend is; a to-one or a to-many relationship.
Example: Bill is friends with Fred and Ted. Alice is also friends with Fred.
does this mean Fred’s super_friend needs to be to-many?
EDIT:
Entity Person Bill’s sub_friend points to Fred and Ted.
Entity Person Alice’s sub_friend points to Fred.
so what relationship does Fred’s super_friend have to Entity Bill and Entity Alice? If I pull up Entity Fred, will it only point to Bill or Alice?
I think that just answered my question. I would need Entity Fred to point to both Bill and Alice, so to-many. I want each Entity to be Unique.
What if i don’t care about who Fred’s super_friends are? i would only ever transverse “down” through sub_friends, never “back up” through super_friend/s.
EDIT 2:
Due to confustion let me expand my need: i need to sortive transverse the Entities.
So say I am Bill, i need to see who all Bill’s sub_friends (Fred and Ted). I select Fred. I then need to find all of Fred’s sub_friends and select one, etc. I need to be able to do this n times.
A solution with just a friend relationship would not allow me to keep the friends separate. Say Fred knows John and Stacy. When i query Fred, i won’t know if John is above (super_friend and won’t care about) or if John is a sub_friend (need to present in a table view for selection).
Just look at this diagram:
Like you see Bill has many sub_friend’s, and Fred is sub_friend of many entities.
So it’s a to-many relationship.
EDIT
I thought it was pretty obvious, but sub_friend is the reverse relationship of super_friend, because if Bill has Fred as sub_friend, then fred has Bill as super_friend.