title: NHibernate: An association from the table X refers to an unmapped class: X
body: <p>I have two mapping files for an order and a customer object.</p>
  
  <p>Customer Mapping:
      
      </p>
  
  <pre><code>  &lt;class name="OODB.Domain.Customer, OODB.Domain" entity-name="Customers"&gt;
       &lt;id name="ID" column="customer_id"&gt;
        &lt;generator class="guid" /&gt;
       &lt;/id&gt;
       &lt;property name="FirstName" column="first_name"/&gt;
       &lt;property name="LastName" column="last_name"/&gt;
       &lt;property name="EMail" column="email"/&gt;
       &lt;property name="Telephone" column="telephone" /&gt;
  
      &lt;component name="Address" class="Address"&gt;
         &lt;property name="Street" column="street"&gt;&lt;/property&gt;
         &lt;property name="PostalCode" column="postal_code"&gt;&lt;/property&gt;
         &lt;property name="City" column="city"&gt;&lt;/property&gt;
      &lt;/component&gt;
    &lt;/class&gt;
   &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Order Mapping: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="OODB.Domain"   namespace="OODB.Domain"&gt;  
    &lt;class name="OODB.Domain.CustomerOrder, OODB.Domain" entity-name="Orders"&gt;
      &lt;id name="ID" column="order_id"&gt;
        &lt;generator class="guid"&gt;&lt;/generator&gt;
      &lt;/id&gt;
      &lt;property name="OrderNo" column="order_no" length="8" not-null="true"&gt;&lt;/property&gt;
      &lt;property name="Status" column="status" not-null="true"&gt;&lt;/property&gt;
      &lt;many-to-one name="Orderer" class="Customer" column="customer_id" insert="true" not-found="exception" fetch="join"/&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Customer class:</p>
  
  <pre><code>namespace OODB.Domain
  {
      public class Customer : ModelBase&lt;Customer&gt;
      {
          public virtual string FirstName
          {
              get;
              set;
          }
  
          public virtual string LastName
          {
              get;
              set;
          }
  
          public virtual string EMail
          {
              get;
              set;
          }
  
          public virtual string Telephone
          {
              get;
              set;
          }
  
          public virtual Address Address
          {
              get;
              set;
          }
  
  ...
  }
  </code></pre>
  
  <p>Customer Order class:</p>
  
  <pre><code>public class CustomerOrder : ModelBase&lt;CustomerOrder&gt;
  {
      public virtual string OrderNo
      {
          get;
          set;
      }
  
      public virtual Customer Orderer
      {
          get;
          set;
      }
  
      public virtual OrderStatus Status
      {
          get;
          set;
      }
  ...
  }
  </code></pre>
  
  <p>Everything works great, if I remove the many-to-one stuff (Mappings are integrated as an embedded resource. I've checked this twice.). Otherwise I get the error 'An association from the table Orders refers to an unmapped class: OODB.Domain.Customer'. But the Customer object is mapped... What I am missing?</p>