In nHibernate, can I map an abstract base class to a collection? <p>I have a base class for content items in a CMS I'm building. It's currently marked abstract because I only want derived classes to be instantiated. Derived classes like BlogPost, Article, Photo, etc. are set up as a joined subclass to my ContentBase class in nHibernate.</p> <p>I'm trying to set up a many-to-many mapping between this class and a Tag class. I want to have a collection of Tags on the ContentBase class, and a collection of ContentBase items on the tag class.</p> <p>Will nHibernate allow me to map the abstract ContentBase class as a collection on the Tag class? I'm assuming not since it wouldn't be able to instantiate any instances of this class when reconstituting a Tag entity from the db. I really don't want to have to have to use a collection of content items per type (e.g. TaggedBlogPosts, TaggedArticles, etc.) on the Tag class.</p> <p>The whole reason I'm doing this is because logically, a content item can have many tags, and 1 tag can belong to multiple content items. in order for nHibernate to manage the relationships for me in a mapping table, I believe I have to set up a many-to-many association and add the Tag to the ContentBase.Tags collection and then the content item to the Tags.TaggedContentItems collection before the mapping table entry is created in nHibernate.</p> <p>Here are my mappings for reference:</p> <pre><code> &lt;class name="CMS.Core.Model.Tag,CMS.Core" table="bp_Tags"&gt; &lt;id column="TagName" name="TagName" type="String" unsaved-value=""&gt; &lt;generator class="assigned" /&gt; &lt;/id&gt; &lt;bag name="_taggedContentList" table="bp_Tags_Mappings" inverse="true" cascade="save-update" lazy="true"&gt; &lt;key column="TagName" /&gt; &lt;many-to-many class="CMS.Core.Model.ContentBase,CMS.Core" column="Target_Id" /&gt; &lt;/bag&gt; &lt;/class&gt; &lt;class name="CMS.Core.Model.ContentBase,CMS.Core" table="bp_Content"&gt; &lt;id name="Id" column="Id" type="Int32" unsaved-value="0"&gt; &lt;generator class="native"&gt;&lt;/generator&gt; &lt;/id&gt; &lt;property name="SubmittedBy" column="SubmittedBy" type="string" length="256" not-null="true" /&gt; &lt;property name="SubmittedDate" column="SubmittedDate" type="datetime" not-null="true" /&gt; &lt;property name="PublishDate" column="PublishDate" type="datetime" not-null="true" /&gt; &lt;property name="State" column="State" type="CMS.Core.Model.ContentStates,CMS.Core" not-null="true" /&gt; &lt;property name="ContentType" column="ContentType" type="CMS.Core.Model.ContentTypes,CMS.Core" not-null="true" /&gt; &lt;bag name="_tagsList" table="bp_Tags_Mappings" lazy="false" cascade="save-update"&gt; &lt;key column="Target_Id" /&gt; &lt;many-to-many class="CMS.Core.Model.Tag,CMS.Core" column="TagName" lazy="false" /&gt; &lt;/bag&gt; ... &lt;joined-subclass name="CMS.Core.Model.BlogPost,CMS.Core" table="bp_Content_BlogPosts" &gt; &lt;key column="Id" /&gt; &lt;property name="Body" type="string" column="Body" /&gt; &lt;property name="Title" type="string" column="Title" /&gt; &lt;/joined-subclass&gt; ... </code></pre>