title: NHibernate: mapping a one-to-many relationship to fill a collection without the use of a second class
body: <p>The database that I'm trying to map with NHibernate has a Plan table and a Date table. One plan can be associated with many dates, this is modelled by the Date table having a PLAN_ID foreign key column.</p>
  
  <p>These are my current classes and mappings:</p>
  
  <pre><code>public class Plan
  {
      public virtual int Id { get; set; }
      public virtual IList&lt;PlanDate&gt; Dates { get; set; }
  }
  
  public class PlanDate
  {
      public virtual int Id { get; set; }
  
      public virtual int PlanId { get; set; }
  
      public virtual DateTime? Date { get; set; }
  }
  </code></pre>
  
  <p></p>
  
  <pre><code>  &lt;class name="Plan" table="PLAN"&gt;
      &lt;id name="Id" unsaved-value="0"&gt;
        &lt;column name="ID" not-null="true" /&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;bag name="Dates"&gt;
        &lt;key column="PLAN_ID" /&gt;
        &lt;one-to-many class="PlanDate" /&gt;
      &lt;/bag&gt;
    &lt;/class&gt;
    &lt;class name="PlanDate" table="PLAN_DATE"&gt;
      &lt;id name="Id" unsaved-value="0"&gt;
        &lt;column name="ID" not-null="true" /&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;property name="Date" column="DATE" type="DateTime"/&gt;
      &lt;property name="PlanId" column="PLAN_ID" type="integer"/&gt;
    &lt;/class&gt;
  </code></pre>
  
  <p>This correctly fills the Dates collection in a Plan object with PlanDate objects. However, ideally I would like to have a collection of DateTime objects in the Plan class. I have no use for the PlanDate class other than for containing dates and I'm not going to update the data in the database. Example:</p>
  
  <pre><code>public class Plan
  {
      public virtual int Id { get; set; }
      public virtual IList&lt;DateTime&gt; Dates { get; set; }
  }
  </code></pre>
  
  <p>Is there any way to map to this class structure, and to get rid of the PlanDate class?</p>