title: NHibernate HasOne reference returning null
body: <p>I'm using NHibernate and have a <code>Product</code> entity which can have 0 or 1 <code>ProductStats</code> entity.</p>
  
  <p><strong>ProductMap</strong></p>
  
  <pre><code>References(x =&gt; x.Manufacturer);
  
  HasOne(x =&gt; x.Stats)
              .PropertyRef(x =&gt; x.Product)
              .Cascade.All();
  </code></pre>
  
  <p><strong>ProductStatsMap</strong></p>
  
  <pre><code>References(x =&gt; x.Product);
  </code></pre>
  
  <p><strong>Database</strong></p>
  
  <pre><code>Product
   +ManufacturerId
  
  ProductStats
   +ProductStatId
   +ProductId
  </code></pre>
  
  <p>I'm using the following query to try and load a list of products and their associated ProductStats if it exists.</p>
  
  <pre><code>var products = Session.Query&lt;Product&gt;()            // Using NHibernate.Linq
                        .Select(x =&gt; new
                        {
                            x.Manufacturer,          // Returns object correctly
                            x.Stats,                 // Returns null
                            x.Stats.ProductStatId    // Returns ID correctly
                         })
  </code></pre>
  
  <p>The <code>Stats</code> property always returns null, but if I try and query a property of <code>Stats</code>, it works fine, which indicates that the mapping itself is correct.  It just refuses to load the entire entity as part of this query.  The Manufacturer property which was mapped using <code>References</code> works fine.</p>
  
  <p>Why is the Stats property not being loaded, and how can I resolve this?</p>