A user may have several labels, and links. Then, a user associates a label (or more) to a link. How does one represent the later relationship?
A solution could be a many-to-many relationship btw user and link with the optional attribute label. http://en.wikibooks.org/wiki/Java_Persistence/ManyToMany#Mapping_a_Join_Table_with_Additional_Columns In this case the relationship btw user and label may better be 'virtual'.
Any alternative I'm not seeing?
PS: I've used google bookmarks terminology, as it matches my case quite well.
If my understanding is correct, then you are in the following case:
Replacing ternary relationships
When ternary relationships occurs in an ER model they should always be removed before finishing the model. Sometimes the relationships can be replaced by a series of binary relationships that link pairs of the original ternary relationship.
(source: grussell.org) Figure
: A ternary relationship example
- This can result in the loss of some information - It is no longer clear which sales assistant sold a customer a particular product.
- Try replacing the ternary relationship with an entity type and a set of binary relationships.
Relationships are usually verbs, so name the new entity type by the relationship verb rewritten as a noun.
- The relationship sells can become the entity type sale.
(source: grussell.org)Figure : Replacing a ternary relationship
- So a sales assistant can be linked to a specific customer and both of them to the sale of a particular product.
- This process also works for higher order relationships.
And this would be my suggestion: introduce a new entity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With