title: HIbernate : More than one row with the given identifier was found
body: <pre><code>@Override
      public Application getApplicationForId(Long applicationId) {
  
          List&lt;Application&gt; applications = executeNamedQuery("applicationById", Application.class, applicationId);
          return applications.isEmpty() ? null : applications.get(0);
      }
  </code></pre>
  
  <p>while debugging in eclipse</p>
  
  <p><strong><em>return applications.isEmpty() ? null : applications.get(0);</em></strong> </p>
  
  <p>these expression getting evaluated as</p>
  
  <p><strong>applications.isEmpty() -> false</strong></p>
  
  <p><strong>applications.get(0) -> (id=171)</strong></p>
  
  <p><strong>applications.size() -> 1</strong></p>
  
  <p>but after the execution of this line its throwing error</p>
  
  <p><strong>org.hibernate.HibernateException: More than one row with the given identifier was found: 263536,</strong></p>
  
  <p>Even its size is showing as 1, then still why and how its getting multiple rows after the execution.</p>