title: NHibernate <one-to-many>
body: <p>How can I map these two classes?</p>
  
  <pre><code>public class LDAVehicle 
  {
      public virtual int VehicleId { get; set; }
      public virtual string ChassisSeries { get; set; }
      public virtual string ChassisNumber { get; set; }
  
      public virtual List&lt;LDAReading&gt; Readings { get; set; }
  }
  
  public class LDAReading 
  {
      public virtual int ReadingId { get; set; }
      public virtual DateTime IncomingDate { get; set; }
      public virtual DateTime ReadoutDate { get; set; }
      public virtual string Sender { get; set; }
  
      public virtual LDAVehicle Vehicle { get; set; }
  }
  </code></pre>
  
  <p>Accually I have this xml:</p>
  
  <pre><code>&lt;class name="LDAVehicle" table="Vehicle" schema="dbo" lazy="false"&gt;
      &lt;id name="VehicleId"&gt;
          &lt;column name="VehicleId" /&gt;
          &lt;generator class="native"&gt;&lt;/generator&gt;
      &lt;/id&gt;
      &lt;property name="ChassisSeries" column="ChassisSeries" not-null="false" /&gt;
      &lt;property name="ChassisNumber" column="ChassisNumber" not-null="false" /&gt;
  
      &lt;set name="Readings" table="Reading" fetch="join"&gt;
          &lt;key foreign-key="VehicleId" /&gt;
          &lt;one-to-many class="LDAReading" /&gt;
      &lt;/set&gt;
  &lt;/class&gt;
  
  &lt;class name="LDAReading" table="Reading" schema="dbo" lazy="false"&gt;
      &lt;id name="ReadingId"&gt;
          &lt;column name="ReadingId" /&gt;
          &lt;generator class="native"&gt;&lt;/generator&gt;
      &lt;/id&gt;
      &lt;property name="IncomingDate" column="IncomingDate" not-null="true" /&gt;
      &lt;property name="ReadoutDate" column="ReadoutDate" not-null="true" /&gt;
      &lt;property name="Sender" column="Sender" not-null="false" /&gt;
      &lt;many-to-one name="Vehicle" class="LDAVehicle" fetch="select" column="VehicleId" /&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p>But I get an error:</p>
  
  <blockquote>
    <p>An association from the table Reading refers to an unmapped class</p>
  </blockquote>