title: org.hibernate.ObjectNotFoundException: No row with the given identifier exists
body: <ol>
  <li>EmpInformation file contains the <code>&lt;composite-id&gt;</code> tag having many-to-one with Department Class.</li>
  </ol>
  
  <p></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
      &lt;class name="EmpInformation" table="emp_info" &gt;
  
          &lt;composite-id name="id" class="info"&gt;
                 &lt;key-property name="XXXid" type="int"&gt;
                      &lt;column name="xxxid" /&gt;
                 &lt;/key-property&gt;
            &lt;key-property name="AAA" type="string"&gt;
                      &lt;column name="aaa" length="50" /&gt;
                 &lt;/key-property&gt;
                 &lt;key-property name="BBB" type="string"&gt;
                      &lt;column name="bbb" length="50" /&gt;
                 &lt;/key-property&gt;
          &lt;/composite-id&gt;
  
          &lt;many-to-one name="Dept" class="Department" update="false" insert="false" fetch="select"&gt;
                      &lt;column name="AAA" length="50" not-null="true" /&gt;
                 &lt;column name="BBB" length="50" not-null="true" /&gt;
          &lt;/many-to-one&gt;
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <ol start="2">
  <li>Department class having some more mapping many-to-one and some properties.</li>
  </ol>
  
  <p></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
      &lt;class name="Department" table="dept_table"&gt;
  
          &lt;composite-id name="id" class="deptId"&gt;
  
        &lt;key-property name="AAA" type="string"&gt;
                  &lt;column name="aaa" length="50" /&gt;
              &lt;/key-property&gt;
              &lt;key-property name="BBB" type="string"&gt;
                  &lt;column name="bbb" length="50" /&gt;
              &lt;/key-property&gt;
          &lt;/composite-id&gt;
  
       &lt;many-to-one name="Store" class="DepartmentStore" update="false" insert="false" fetch="select"&gt;
              &lt;column name="AAA" length="50" not-null="true" /&gt;
         &lt;column name="BBB" length="50" not-null="true" /&gt;
          &lt;/many-to-one&gt;
  
          &lt;property name="ReportId" type="java.lang.Integer"&gt;
              &lt;column name="report_id" /&gt;
          &lt;/property&gt;
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>My Questions is whenever I am trying to call the ReportID on getDepartment it's giving error as org.hibernate.ObjectNotFoundException: No row with the given identifier exists: 
  It seems I am not getting the Department info.</p>
  
  <ol>
  <li><p>List a  = createCriteria(EmpInformation.class);</p></li>
  <li><p>Integer I = a.getDepartment().getReportID();</p></li>
  </ol>
  
  <p>This is the stmt we are using to access the Dept information:</p>
  
  <pre><code>&lt;many-to-one name="Dept" class="Department" update="false" insert="false" fetch="select"&gt;
  </code></pre>
  
  <p>I want to point some more info here</p>
  
  <ol>
  <li>Lazy is true by default so whenever I access the child table entity it should get that info but it won't. </li>
  <li>It's mandatory update="false" insert="false" if I remove then it's asking me to put that.</li>
  </ol>
  
  <p>I looks like data issue but still not able to find what's going on.</p>