title: Criteria list returning empty list but there are rows in oracle db
body: <p>I run sql statement "SELECT * FROM company" on oracle Thin 11 g and it returns 3 rows.</p>
  
  <p>I have configured the data source correctly and tried Query as well Criteria as follows and all of them return nothing even if they should return 3 rows.
  <strong>//import org.hibernate.Criteria;</strong></p>
  
  <h1>1. <strong>Criteria</strong></h1>
  
  <pre><code> Criteria criteria = session.createCriteria(Company.class);
              criteria
                       .add(Restrictions.eq("companyName", companyName))
                       .add(Restrictions.eq("companyId", companyId));
  
  List&lt;Company&gt; companyList  = criteria.list();//**THIS RETURNS 0 ROWS**
  </code></pre>
  
  <h1>2. <strong>QUERY</strong></h1>
  
  <pre><code>Query query=session.createQuery("from Company where companyName= :companyName and companyId= :companyId");
  
             query.
                     setParameter("companyId",companyId).
                     setParameter("companyName", companyName);
  
  List&lt;Company&gt; companyList  = query.list();//**THIS RETURNS 0 ROWS**
  </code></pre>
  
  <h1>3.<strong>SQL in Query</strong></h1>
  
  <pre><code>Query query=session.createSQLQuery("SELECT * FROM Company");
  List&lt;Company&gt; CompanyList  = query.list();//**THIS RETURNS 0 ROWS**
  </code></pre>
  
  <p><strong>Here Company Entity</strong></p>
  
  <p>//<strong>javax.persistence.*;</strong></p>
  
  <pre><code>@Entity
  @Table(name = "COMPANY")
  public class Company {
  
      @Id
      @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="COMPANY_SEQ")
      @SequenceGenerator(name="COMPANY_SEQ", sequenceName="COMPANY_SEQ",   allocationSize=1)
      @Column(name = "COMPANY_ID")
      int CompanyId;
  
      @Basic
      @Column (name ="COMPANY_NAME")
      private String companyName;
  
  
      @Basic
      @Column (name ="COMPANY_ID")
      private Integer companyId;// The login id of user whose data is updated
  
      @Basic
      @Column (name ="UPDATED_BY")
      private String updatedBy;
  
      @Basic
      @Column (name ="UPDATE_DATE")
      private Date updateDate;
  
       //Default no-arg constructor and another constructor with all the fields.
      //default getters and Setters
  }
  </code></pre>
  
  <p>What am I missing and why is not all the hibernate queries not returning the rows? I appreciate your help.</p>