title: How can I use Fluent NHibernate to discriminate on a column of a parent relationship
body: <p>I have this entity relationship.</p>
  
  <pre><code>public abstract class UserGroup
  {
      public virtual int UserGroupId { get; set; }
      public virtual int GroupType { get; set; }
      public virtual string GroupName { get; set; }
      public virtual IList&lt;UserGroupMember&gt; GroupMembers { get; set; }
  }
  
  public class UserGroupMember
  {
     public virtual int UserGroupMemberId { get; set; }
     public virtual User User { get; set; }
     public virtual UserGroup UserGroup { get; set; }
  }
  </code></pre>
  
  <p>Note that <code>UserGroup</code> is base class and that I have a few derived classes that are discriminated by <code>UserGroup.GroupType</code>. I am using the <em>Single Table Per Class Hierarchy</em> inheritance mapping strategy.</p>
  
  <p>Fluent NHibernate mappings:</p>
  
  <pre><code>public class UserGroupMap : BaseClassMap&lt;UserGroup&gt;
  {
      public UserGroupMap()
      {
          Table("UserGroup");
          Id(x =&gt; x.UserGroupId);
  
          DiscriminateSubClassesOnColumn("GroupType");
  
          Map(x =&gt; x.GroupName);
  
          HasMany(x =&gt; x.GroupMembers)
              .KeyColumn("UserGroupId")
              .Cascade.AllDeleteOrphan()
              .Inverse();
      }
  }
  
  public class UserGroupMemberMap: BaseClassMap&lt;UserGroupMember&gt;
  {
      public UserGroupMemberMap()
      {
          Table("UserGroupMember");
          Id(x =&gt; x.UserGroupMemberId);
  
          References(x =&gt; x.User, "UserId")
              .Cascade.SaveUpdate();
  
          References(x =&gt; x.UserGroup, "UserGroupId")
              .Cascade.SaveUpdate();
      }
  }
  </code></pre>
  
  <p><strong>This is what I want to achieve:</strong><br>
  I would like to make UserGroupMember a base class also and have it discriminate on the <code>UserGroup.GroupType</code> discriminator. Is this possible?</p>
  
  <p>Another way of wording this question, it would be <em>great</em> if I could add the following line:</p>
  
  <pre><code>DiscriminateSubClassesOnColumn("UserGroup.GroupType");
  </code></pre>
  
  <p>Into the <code>UserGroupMemberMap</code></p>