title: Fluent NHibernate Mapping not on PK Field
body: <p>I have the following tables and cannot edit their structure...</p>
  
  <pre><code>Person
  ------
  Id PK
  Code
  Name
  
  Order
  -----
  Id PK
  Person_Code
  OrderDetails
  </code></pre>
  
  <p>Now in my Person class I want to have a list of Orders for that person, but I'm not entirely sure how to go about setting up the mapping in fluent nhibernate to match on the Code column rather than the ID.  There is no foreign key constraint and I am unable to change the database to use the keys.  Something like this is what I require, but can;t seem to figure out the mapping.</p>
  
  <pre><code>public class Person
  {
      public virtual int Id { get; set; }
      public virtual string Code { get; set; }
      public virtual IList&lt;Order&gt; Orders { get; private set; }
  }
  
  public class Order
  {
      public virtual int Id { get; set; }
      public virtual string OrderDetails { get; set; }
      public virtual Person Owner { get; set; }
  }
  </code></pre>