title: Association references unmapped class (.net)
body: <p>Even though the hbm is set as an embedded resource, NHibernate gives me this error:</p>
  
  <p>Association references unmapped class: UploadPromotions.Models.StagedPromotionImage</p>
  
  <p>The mapping is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
  assembly="UploadPromotions.Models"
  namespace="UploadPromotions.Models"&gt;
    &lt;typedef
     name="blobbedItem"
     class="UploadPromotions.Models.Blobbed, UploadPromotions.Models"&gt;
      &lt;param name="classType"&gt;Legacy.Item,Legacy&lt;/param&gt;
    &lt;/typedef&gt;
    &lt;typedef
    name="blobbedSupplier"
    class="UploadPromotions.Models.Blobbed, UploadPromotions.Models"&gt;
      &lt;param name="classType"&gt;Legacy.ItemFromSupplier,Legacy&lt;/param&gt;
    &lt;/typedef&gt;
    &lt;typedef
   name="photoText"
   class="UploadPromotions.Models.Blobbed, UploadPromotions.Models"&gt;
      &lt;param name="classType"&gt;UploadPromotions.Models.PhotoText,UploadPromotions.Models&lt;/param&gt;
    &lt;/typedef&gt;
    &lt;union-subclass name="StagedPromotionImage" extends="DiskImage"&gt;
      &lt;many-to-one name="CurrentStage" class="Stage" column="StageId" cascade="none"&gt;&lt;/many-to-one&gt;
      &lt;set name="Stages" table="StageForPromotionsTable" cascade="none" batch-size="20" access="field.camelcase-underscore"&gt;
        &lt;key column="PromotionId"/&gt;
        &lt;many-to-many class="Stage" column="StageId"/&gt;
      &lt;/set&gt;
      &lt;many-to-one name="BaseImage" class="DiskImage" column="DiskImageId"&gt;&lt;/many-to-one&gt;
      &lt;property name="Created"&gt;&lt;/property&gt;
      &lt;property name="Modified"&gt;&lt;/property&gt;
      &lt;property name ="Name"&gt;&lt;/property&gt;
      &lt;property name="From" column="FromDate" not-null="true"&gt;&lt;/property&gt;
      &lt;property name="To" column="ToDate" not-null="true"&gt;&lt;/property&gt;
      &lt;property name="Description" type="AnsiString" length="100" not-null="true"&gt;&lt;/property&gt;
      &lt;property name="Commited"&gt;&lt;/property&gt;
      &lt;property not-null="true" name ="Art" type="NHibernate.Type.EnumStringType`1[[ADAutoTotal.UploadPromotions.Models.Art,ADAutoTotal.UploadPromotions.Models]], NHibernate"&gt;&lt;/property&gt;
      &lt;property not-null="true" name ="Use" column="UsageType" type="NHibernate.Type.EnumStringType`1[[ADAutoTotal.UploadPromotions.Models.Use,ADAutoTotal.UploadPromotions.Models]], NHibernate"&gt;&lt;/property&gt;
      &lt;component name="TemplateImage" class="Template"&gt;
        &lt;property name="TemplateName" not-null="true"&gt;&lt;/property&gt;
        &lt;property name="Width" not-null="true" column="TemplateWidth"&gt;&lt;/property&gt;
        &lt;property name="Height" not-null="true" column="TemplateHeight"&gt;&lt;/property&gt;
      &lt;/component&gt;
      &lt;property name="Headline" type="photoText"&gt;&lt;/property&gt;
      &lt;property name="Caption" type="photoText"&gt;&lt;/property&gt;
      &lt;property name="Base64Url" not-null="false"&gt;&lt;/property&gt;
      &lt;property name="Row" column="RowNumber" not-null="true"&gt;&lt;/property&gt;
      &lt;property name="Position" not-null="true"&gt;&lt;/property&gt;
      &lt;many-to-one name="CreatedBy" class="PromotionManager" column="ManagerId" cascade="none"&gt;&lt;/many-to-one&gt;
      &lt;property name="Supplier" type="blobbedSupplier" not-null="false" length="1000"&gt;&lt;/property&gt;
      &lt;property name="Item" column="ForItem" type="blobbedItem" not-null="false" length="1000"&gt;&lt;/property&gt;
      &lt;many-to-one name="LastCommitedVersion" not-null="false" class="CommitedPromotionImage" column="LastCommitedVersionId"&gt;&lt;/many-to-one&gt;
    &lt;/union-subclass&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>I can't see nothing wrong. As for where it's used:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
  assembly="UploadPromotions.Models"
  namespace="UploadPromotions.Models"&gt;
    &lt;class name="PromotionManager"&gt;
      .......
      &lt;set name="StagedPromotionImages" batch-size="50" inverse="true" cascade="all-delete-orphan" access="field.camelcase-underscore"&gt;
        &lt;key column="CreatedById"&gt;&lt;/key&gt;
        &lt;one-to-many class="StagedPromotionImage"/&gt;
      &lt;/set&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>and here:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
  assembly="UploadPromotions.Models"
  namespace="UploadPromotions.Models"&gt;
    &lt;class name="Stage" table="StagedChanges"&gt;
    .........
      &lt;set name="StagedImages" batch-size="50" inverse="true" cascade="all-delete-orphan" access="field.camelcase-underscore"&gt;
        &lt;key column="StageId"&gt;&lt;/key&gt;
        &lt;one-to-many class="StagedPromotionImage"/&gt;
      &lt;/set&gt;
     ............
  
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>WELL, i forgot to add the .hbm part in the mapping filename.....</p>