title: Fluent NHibernate mapping Parent/Child Tables with orphaned child records
body: <p>I'm new to Fluent NHibernate and C#.NET and struggling with this problem.  </p>
  
  <p>I have two tables:</p>
  
  <p><strong>audit</strong>:
   audit_seq  (Primary Key),
   user_code  (Foreign Key),
   audit_date</p>
  
  <p><strong>username</strong>:
   user_code  (Primary Key),
   user_name</p>
  
  <p>The audit table contains audit records with a foreign key field (user_code) for the user.  <strong>The problem</strong> is that some of the user records have been deleted, but the audit records for those users remain (so I have orphaned Foreign Keys in the audit table).  What I want is a result set with audit_seq, audit_date and user_name (but if orphaned the user_name should be blank).</p>
  
  <p>I am using the following mapping, but believe that I need to change the UserName reference to create an outer join.  I am not sure how to do that.  </p>
  
  <pre><code>public class AuditMap : ClassMap&lt;Audit&gt;
  {
      public AuditMap()
      {
          Id(x =&gt; x.AuditSeq).Column("audit_seq").GeneratedBy.Assigned();
          Map(x =&gt; x.AuditDate).Column("audit_date");
          References(x =&gt; x.UserName).Column("user_code");
      }
  }
  </code></pre>