title: NHibernate Mapping a Collection with a Discriminator
body: <p>Let's say that I have a class/table called <code>Images</code> that, as it stands right now, is bound in a manner similar to this:</p>
  
  <pre><code>&lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"&gt;
    &lt;class name="Domain.Image, Domain" table="Images"&gt;
      &lt;id name="id" column="ImageID" access="field" unsaved-value="0"&gt;
        &lt;generator class="identity" /&gt;
      &lt;/id&gt;    
  &lt;!-- other properties --&gt;
      &lt;property name="AssociatedObjectID" column="AssociatedObjectID" /&gt;
      &lt;property name="AssociatedObjectType" column="AssociatedObjectType" /&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Up until this point, this schema has worked, because a image was only associated with one object, so I could keep that reference without a discriminator.</p>
  
  <p>However, now I wish to have a collection of these images on another entity called a <code>PhotoShoot</code>. Each <code>PhotoShoot</code> can have several images.</p>
  
  <p>Is there a way to bind a collection such that I can have a <code>List&lt;Image&gt;</code> within <code>PhotoShoot</code> without extracting a base class and using the table-per-hierarchy inheritance pattern? </p>
  
  <p>And if not, is table-per-hierarchy really the best way to go here? I hate to create subclasses, especially since there is nothing that needs to be abstracted from the <code>Image</code> entity.</p>