Reputation: 7146
Consider the following relationship between Item and ItemContent.
Item
ItemId
ItemName
ItemContent
ContentId
ItemId
Content
ContentType
What I would like to do is have a Content
property on Item that JOINS the Content column from ItemContent based on ContentType that is provided in the mapping itself or injected in some other way.
What is the best way to accomplish this? What is the simplest way to accomplish this?
Upvotes: 0
Views: 155
Reputation: 11910
Well - according to Ayend Rahien it is possible to use a filter directly in the mapping. I have not tried it - but normally it should work if the says it works.
<set name="Comments"
table="Comments">
<key column="PostId"/>
<one-to-many class="Comment"/>
<filter name="effectiveDate"
condition=":asOfDate >= PostedAt"/>
</set>
Here is the whole article about NHibernate filters on his blog
Upvotes: 1