title: Need help with NHibernate / Fluent NHibernate mapping
body: <p>Let's say your have the following table structure:</p>
  
  <pre><code>                  ==============================  
                    | Case                       |
                    ==============================
                    | Id           | int         |
                    | ReferralType | varchar(10) |
          +---------| ReferralId   | int         |---------+
          |         ==============================         |
          |                      |                         |
          |                      |                         |
  ======================  ======================  ======================        
  | SourceA            |  | SourceB            |  | SourceC            |
  ======================  ======================  ======================
  | Id   | int         |  | Id   | int         |  | Id   | int         |
  | Name | varchar(50) |  | Name | varchar(50) |  | Name | varchar(50) |
  ======================  ======================  ======================
  </code></pre>
  
  <p>Based on the ReferralType the ReferralId contains id to the SourceA, SourceB, or SourceC</p>
  
  <p>I'm trying to figure out how to map this using Fluent NHibernate or just plain NHibernate into an object model.  I've tried a bunch of different things but I haven't been succesful.  Any ideas?</p>
  
  <p>The object model might be something like:</p>
  
  <pre><code>public class Case
  { 
    public int Id { get; set; }
    public Referral { get; set; }
  }
  
  public class Referral
  {
    public string Type { get; set; }
    public int Id { get; set; }
    public string Name { get; set; }
  }
  </code></pre>