Versioning of Many-to-Many relationships

14 views
Skip to first unread message

Michael Naber

unread,
Feb 9, 2012, 1:47:34 PM2/9/12
to sqlal...@googlegroups.com
I have a many to many relationship between musician and genre indicating that a particular musician performs in the style of a particular genre: Musician -- musician_genre -- Genre

Musician and Genre are both versioned using VersionedMeta so it is easy for me to display a history of the attributes for a particular record. The hard part is displaying the history of the associations between them. For any particular musician or genre, I want to be able to display the association historically, for example:

Genere 17:
Time1: [Musician 12]
Time2: [Musician 12,  Musician 3, Musician 5]
Time3: [Musician 12, Musician 6]
etc...

Of course I would also want to perform the complimentary action:

Musician 8:
Time1: [Genre 8]
Time2: [Genre 8, Genre 17]
etc...

Approaches that seem bad to me:
1) Serializing a list of musician IDs directly attached to the genre object and vice versa.
2) Using VersionedMeta on the association object, musician_genre.

Does anyone have any other ideas as to how I might accomplish this?

Thanks,
Michael
Reply all
Reply to author
Forward
0 new messages