Hi all,
I have the following tables:
Code:
[b]Note[/b]
id (PK)
text
[b]BookNote[/b]
noteID
bookID
[b]CdNote[/b]
noteID (PK)
cdID (PK)
[b]Book[/b]
id (PK)
otherfields
[b]Cd[/b]
id (PK)
other fields
I am trying to model that a book, can have many notes but but I note only belongs to one book (your usual one-to-many) however in my
wisedom I decided that a note coulde belong to a CD, and a CD can have many notes (again one-to-many), but a note will only ever belong to
one book
or one cd
never both.
I am just wondering how to map this, would it be correct to modely it as a one-to-many relationship between the book and note, and, CD and note? would that work with the assoication table inbetween, i dont think it will.
Or should I use uni directional many-to-many relationship, as I am not intrested in the note knowing what it belongs, so long as teh book and cd acan find all their notes?
Of course in teh future my users might decided they want this functionality, I can solves this be ensuring that a note can only be added to one CD or one book on teh forms :D
G