My object model represents a podcast feed, with channel data and feed items (individual podcasts). This is structured as follows:
PodcastFeed
ChannelData // Property on PodcastFeed
ITunesChannelData // Property on ChannelData
FeedItems // Property on PodcastFeed; collection of PodcastFeedItems
PodcastFeedItem
ITunesItemData // Property on PodcastFeedItem
In my database, the fields on PodcastFeed, ChannelData and ITunesChannelData are all stored in the one table; equally the fields on PodcastFeedItem and ITunesItemData are all stored in a single table. There's a one-to-many relationship from PodcastFeed to PodcastFeedItem. The reason for storing them this way is because there is a one-to-one mapping between the different object types (e.g., the ChannelData is unique to each podcast feed).
I'm ok with the mapping of PodcastFeed to PodcastFeedItem, but what I can't work out how to complete is how to "partition" the data in the Feeds table across the different classes making up the PodcastFeed. I have successfully created NHibernate mappings from the Feeds table to these types, but when I access a PodcastFeed object, the ChannelData property is null. Presumably this is because NHibernate doesn't know to create the hierarchy as described above.
FWIW, I've tried the following line in my mapping file with no success (NHibernate tries to load data from the non-existent "ChannelData" column on the table).
<property name="ChannelData" type="ChannelData" />
Do I need to create a user type in NHibernate to enable this, or am I missing some built-in trick?