title: An association from the table Y refers to an unmapped class: Y - C# NHibernate
body: <p>I'm getting the exception:</p>
  
  <pre><code>"An association from the table order refers to an unmapped class: FrancosPoS.DBMapping.pastaCombo"
  </code></pre>
  
  <p>for this NHibernate mapping:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;hibernate-mapping assembly="FrancosPoS" namespace="FrancosPoS.DBMapping" xmlns="urn:nhibernate-mapping-2.2"&gt;
    &lt;class name="order" table="order" lazy="true" &gt;
      &lt;id name="idOrder"&gt;
        &lt;generator class="identity" /&gt;
      &lt;/id&gt;
      &lt;many-to-one insert="false" update="false" lazy="false" name="idPastaI" class="FrancosPoS.DBMapping.pastaIndividual"&gt;
        &lt;column name="idPastaI" sql-type="int(11)" not-null="false" /&gt;
      &lt;/many-to-one&gt;
      &lt;!--&lt;property name="idPastaI"&gt;
        &lt;column name="idPastaI" sql-type="int(11)" not-null="false" /&gt;
      &lt;/property&gt;--&gt;
      &lt;many-to-one insert="false" update="false" lazy="false" name="pastaCombo" class="FrancosPoS.DBMapping.pastaCombo"&gt;
        &lt;column name="idPastaC" sql-type="int(11)" not-null="false" /&gt;
      &lt;/many-to-one&gt;
      &lt;!--&lt;property name="idPastaC"&gt;
        &lt;column name="idPastaC" sql-type="int(11)" not-null="false" /&gt;
      &lt;/property&gt;--&gt;
      &lt;many-to-one insert="false" update="false" lazy="false" name="idPastaF" class="FrancosPoS.DBMapping.pastaFeast"&gt;
        &lt;column name="idPastaF" sql-type="int(11)" not-null="false" /&gt;
      &lt;/many-to-one&gt;
      &lt;!--&lt;property name="idPastaF"&gt;
        &lt;column name="idPastaF" sql-type="int(11)" not-null="false" /&gt;
      &lt;/property&gt;--&gt;
      &lt;many-to-one insert="false" update="false" lazy="false" name="idSalad" class="FrancosPoS.DBMapping.salad"&gt;
        &lt;column name="idSalad" sql-type="int(11)" not-null="false" /&gt;
      &lt;/many-to-one&gt;
      &lt;!--&lt;property name="idSalad"&gt;
        &lt;column name="idSalad" sql-type="int(11)" not-null="false" /&gt;
      &lt;/property&gt;--&gt;
      &lt;many-to-one insert="false" update="false" lazy="false" name="idDrink" class="FrancosPoS.DBMapping.drink"&gt;
        &lt;column name="idDrink" sql-type="int(11)" not-null="false" /&gt;
      &lt;/many-to-one&gt;
      &lt;!--&lt;property name="idDrink"&gt;
        &lt;column name="idDrink" sql-type="int(11)" not-null="false" /&gt;
      &lt;/property&gt;--&gt;
      &lt;property name="price"&gt;
        &lt;column name="price" sql-type="decimal(8,4)" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="cash"&gt;
        &lt;column name="cash" sql-type="tinyint(1)" not-null="false" /&gt;
      &lt;/property&gt;
      &lt;property name="credit"&gt;
        &lt;column name="credit" sql-type="tinyint(1)" not-null="false" /&gt;
      &lt;/property&gt;
      &lt;property name="obs"&gt;
        &lt;column name="obs" sql-type="varchar(150)" not-null="true" /&gt;
      &lt;/property&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>and this is my cs class:</p>
  
  <pre><code>namespace FrancosPoS.DBMapping {
  
      public partial class order {
          public order() { }
          public virtual int idOrder { get; set; }
          public virtual pastaIndividual pastaIndividual { get; set; }
          public virtual pastaCombo pastaCombo { get; set; }
          public virtual pastaFeast pastaFeast { get; set; }
          public virtual salad salad { get; set; }
          public virtual drink drink { get; set; }
          public virtual string price { get; set; }
          public virtual System.Nullable&lt;int&gt; cash { get; set; }
          public virtual System.Nullable&lt;int&gt; credit { get; set; }
          public virtual string obs { get; set; }
      }
  }
  </code></pre>
  
  <p>pastaCombo mapping:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;hibernate-mapping assembly="FrancosPoS" namespace="FrancosPoS.DBMapping" xmlns="urn:nhibernate-mapping-2.2"&gt;
    &lt;class name="pastaCombo" table="pasta_combo" lazy="true" &gt;
      &lt;id name="idPastaC"&gt;
        &lt;generator class="identity" /&gt;
      &lt;/id&gt;
      &lt;property name="type"&gt;
        &lt;column name="type" sql-type="varchar(25)" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="price"&gt;
        &lt;column name="price" sql-type="decimal(8,4)" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="freeDrink"&gt;
        &lt;column name="freeDrink" sql-type="smallint(5) unsigned" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="freeSalad"&gt;
        &lt;column name="freeSalad" sql-type="smallint(5) unsigned" not-null="true" /&gt;
      &lt;/property&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>pastaCombo class:</p>
  
  <pre><code>namespace FrancosPoS.DBMapping {
  
      public class pastaCombo {
          public pastaCombo() { }
          public virtual int idPastaC { get; set; }
          public virtual string type { get; set; }
          public virtual string price { get; set; }
          public virtual int freeDrink { get; set; }
          public virtual int freeSalad { get; set; }
      }
  }
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>Sincerely,</p>
  
  <p>PS.: The properties are commented because I (think that I) don't need them as my class has the object type, not the int ID. If I use it NHibernate throw the error of "trying to set property type by reflection".</p>
  
  <p>EDIT: Included pastaCombo mapping and class.</p>