title: nhibernate mapping by code approach, mapping object
body: <p>I have following model</p>
  
  <pre><code>public class Car : Entity&lt;int&gt;
  {
      public virtual int Id{ get; set; }
      ...
      public virtual Engine Engine { get; set; }
  
  }
  </code></pre>
  
  <p>and I'm using <code>nhibernate mapping by code approach</code></p>
  
  <pre><code>public class CarMap : ClassMapping&lt;Car&gt;
  {
      public CarMap()
      {
          Id(x =&gt; CarId, m =&gt; m.Generator(Generators.Identity));
          // how map reference Engine?  
          **// edit**
          HasOne(x=&gt;x.Engine, m=&gt;{}) // is this good enough?
  
      }
  }
  </code></pre>
  
  <blockquote>
    <p>how map Engine in this CarMap object?</p>
  </blockquote>