title: Failed hibernate mapping: An association from the table X refers to an unmapped class Y
body: <p>Hi I'm trying to map this pojo Rent class to create his hibernate mapping file .</p>
  
  <p><b>Rent.java (POJO):</b></p>
  
  <pre><code>  public class Rent implements Serializable {
  
       private static final long serialVersionUID = 1L;
  
         Employee employee;
         Client client;
         Car car;
  
      /* + getter and setter... */
    } 
  </code></pre>
  
  <p>My intention is to create web-application where the user can set which employee have rented a car to a client.So this is the implementation i've tried</p>
  
  <p><b>Rent.hbm.xml</b> :</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
    &lt;class name="com.google.musicstore.domain.Rent" table="RENT"&gt;
      &lt;id name="id" column="RENT_ID"&gt;
         &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;one-to-one name="car"  class="com.project.domain.Car"
         cascade="save-update"&gt;
      &lt;/one-to-one&gt;
      &lt;one-to-one name="client"  class="com.project.domain.Client"
         cascade="save-update"&gt;
      &lt;/one-to-one&gt;
      &lt;many-to-one name="employee"  class="com.project.domain.Employee"
         cascade="save-update"&gt;
      &lt;/many-to-one&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>But it gives me this error:</p>
  
  <pre><code>   [java] Initial SessionFactory creation failed.org.hibernate.MappingException: An association from the table RENT refers to an unmapped class: com.project.domain.Employee
  </code></pre>
  
  <p>What am i doing wrong? Thank you for the help.</p>
  
  <p>I've also mapped all the entities in the <b>hibernate.cfg.xml</b>:</p>
  
  <pre><code>    &lt;mapping resource="com/project/carRentalAgency/domain/Employee.hbm.xml"/&gt;
      &lt;mapping resource="com/project/carRentalAgency/domain/Client.hbm.xml"/&gt;
      &lt;mapping resource="com/project/carRentalAgency/domain/Car.hbm.xml"/&gt;
      &lt;mapping resource="com/project/carRentalAgency/domain/Rent.hbm.xml"/&gt;
  </code></pre>
  
  <p>[EDIT] As request i've added the files
  <b>Employee.hbm.xml</b></p>
  
  <pre><code>   &lt;hibernate-mapping&gt;
         &lt;class name="com.project.carRentalAgency.domain.Employee" table="EMPLOYEE"&gt;
              &lt;id name="id" type="long" access="field"&gt;
                  &lt;column name="ID" /&gt;
                  &lt;generator class="increment" /&gt;
              &lt;/id&gt;
              &lt;property name="name" type="java.lang.String" access="field"&gt;
                  &lt;column name="EMPLOYEE_NAME" /&gt;
             &lt;/property&gt;
             &lt;property name="surname" type="java.lang.String"&gt;
                  &lt;column name="EMPLOYEE_SURNAME" /&gt;
             &lt;/property&gt;
             &lt;property name="username" type="java.lang.String"&gt;
                  &lt;column name="EMPLOYEE_USERNAME" /&gt;
             &lt;/property&gt;
             &lt;property name="password" type="java.lang.String"&gt;
                  &lt;column name="EMPLOYEE_PASSWORD" /&gt;
             &lt;/property&gt;
  
        &lt;/class&gt;
     &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p></p>