You could use a key-many-to-one
instead of key-property
, i.e.
<class name="PlaylistItem" table="[PlaylistItems]" lazy="false" >
<composite-id>
<key-property name="Id" />
<key-many-to-one name="Playlist" column="PlaylistId"/>
</composite-id>
<property name="Title" not-null="true" />
</class>
Then your class would look like...
[DataContract]
public class PlaylistItem
{
// Your composite key...
[DataMember(Name = "id")]
public Guid Id { get; set; }
public Playlist Playlist { get; set; }
// Store Title on PlaylistItem as well as on Video because user might want to rename PlaylistItem.
[DataMember(Name = "title")]
public string Title { get; set; }
// rest of class...
}