views:

15

answers:

1

I am using NHibernate to persist information in my media player app. Basically at the minute I have a mapping setup for the Track class and for the Playlist class:

Track                      Playlist
======                     =========
Id                         Id
Name                       Name
FilePath
etc...

This is working fine. However now I want to create a relationship table between these 2 entities :- PlaylistTracks

PlaylistTracks
===============
PlaylistId
TrackId

The tracks that are in a playlist are held as a list of tracks in the playlist object. My question is how do I create this mapping to get the required table strucutre

thanks in advance

A: 

Use a many-to-many mapping to achieve this. Are you using XML or fluent mapping?

Jamie Ide