title: Hibernate criteria returns empty list but data exists. Using annotation
body: <p>I can't figure out why this query isn't giving me any result. I know the data exists in the table. 
  The list variable "<code>results</code>" is empty when the query is executed. Am I implementing the composite key correctly? </p>
  
  <p>I even tried using the <code>@EmbeddedId</code> to get this done but the returned list was still empty. </p>
  
  <pre><code>        Session sess = HibernateUtil.getSession();
          Criteria criteria = sess.createCriteria(Employee.class);
          criteria.add(Restrictions.eq("employeeId", 255847208));
          criteria.add(Restrictions.eq("serialId", 461));
          List&lt;Employee&gt; results = criteria.list();
  </code></pre>
  
  <p><strong>Primary key class</strong>           </p>
  
  <pre><code>public class EmpPrmryKey implements Serializable {
          private Integer employeeId;
          private Integer serialId;
          //getters and setters
  }
  </code></pre>
  
  <p><strong>POJO Mapped to Table:</strong></p>
  
  <pre><code>@Entity
  @IdClass(EmpPrmryKey.class)
  @Table(name = "EMPLOYEE")
  public class Employee{
  
      private EmpPrmryKey compositeId;
  
      @Id
      @Column(name = "employee_id")
      private Integer employeeId; 
  
      @Id
      @Column(name = "serial_id")
      private Integer serialId;
  
      //getters and setters
  }
  </code></pre>