title: Transiend Exception NHibernate
body: <p>I have 3 tables: </p>
  
  <p>Employee {PK: EmployeeId, name, lastname}
  Project {PK: ProjectId, name, description}</p>
  
  <p>EmployeebyProject {<strong>PK:EmployeeId</strong> :int, <strong>PK:ProjectId</strong> :Project, DateBegin :int, DateEnd : DateTime}</p>
  
  <p>I need make some CRUD's in this table.</p>
  
  <p>for now I need Insert, by the way in the software in nhibernate the class EmployeebyProject have the object Employee and Project instead of EmployeeId and ProjectId.</p>
  
  <p>This is the mapping</p>
  
  <pre><code>&lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                     assembly="AdminProject"
                     namespace="AdminProject.Business.Entity"&gt;
  
    &lt;class name="EmployeebyProject"&gt;
  
      &lt;composite-id&gt;
        &lt;key-many-to-one name="Employee" column="EmployeeId"  class="Employee"&gt;&lt;/key-many-to-one&gt;
        &lt;key-many-to-one name="Project" column="ProjectId"  class="Project" &gt;&lt;/key-many-to-one&gt;
      &lt;/composite-id&gt;
  
  
      &lt;property name="DateBegin"/&gt;
      &lt;property name="DateEnd"/&gt;
  
    &lt;/class&gt;
  
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>The problem is when I try to save occurs the NHibernate.TransientObjectException. How can I avoid it?</p>