title: Fluent NHibernate join not using primary key
body: <p>I am trying to get a single property from a joined table where a non-PK in my main table is joined to the PK of the foreign table.  Below is an <strong>oversimplified</strong> example of what I am trying to accomplish (<strong>I do not want to reference the foreign entity</strong>):</p>
  
  <p><strong>Tables:</strong></p>
  
  <pre><code>CREATE TABLE Status
  (
    Id int,
    Body text,
    CategoryId int
  )
  
  CREATE TABLE Category
  (
    Id int,
    Name text
  )
  </code></pre>
  
  <p><strong>SQL to generate:</strong></p>
  
  <pre><code>SELECT Id, Body, CategoryId, Category.Name AS CategoryName
  FROM Status
  LEFT JOIN Category ON Category.Id = Status.CategoryId
  </code></pre>
  
  <p>I am trying to map the join like this in the StatusMap but it seems to be joining on the two primary keys (where Status.Id = Category.Id):</p>
  
  <pre><code>Join("Category" m =&gt;
  {
    m.Optional();
    m.KeyColumn("CategoryId");
    m.Map(x =&gt; x.CategoryName, "Name");
  });
  </code></pre>