title: why Hibernate criteria return empty list if I have data in my table?
body: <p>I didn't understand why I am getting empty list from <code>criteria</code>, and I have data in my table.</p>
  
  <p>code where I'm getting List:</p>
  
  <pre><code>hibernateSession_destination = HibernateUtilReports.INSTANCE.getSession();
  
          Criteria criteria = hibernateSession_destination.createCriteria(nr_rec_backup_rule.class);
          List list = criteria.list();
          System.out.println("List length =======  " + list.size()); // prints size = 0
  </code></pre>
  
  <p>My HibernateUtilReports.java :</p>
  
  <pre><code>public enum HibernateUtilReports {
      INSTANCE;
      public static SessionFactory sessionFactory = null;
  
  private synchronized SessionFactory getSessionFactory(){
  
      if(sessionFactory == null){
          Configuration config = new Configuration();
          config.addAnnotatedClass(contaque_recording_log.class);
          config.addAnnotatedClass(contaque_servers.class);
          config.configure("reportshibernate.cfg.xml"); // is here any error???
  
          Properties configProperties = config.getProperties();
          ServiceRegistryBuilder serviceRegisteryBuilder = new ServiceRegistryBuilder();
          ServiceRegistry serviceRegistry = serviceRegisteryBuilder.applySettings(configProperties).buildServiceRegistry();
          sessionFactory = config.buildSessionFactory(serviceRegistry);
      }
      return sessionFactory;
  }
  
  public Session getSession(){
      return getSessionFactory().openSession();
  }
  }
  </code></pre>
  
  <p>My reportshibernate.cfg.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;property name="connection.driver_class"&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/property&gt;
          &lt;property name="connection.url"&gt;jdbc:oracle:thin:@8080/xe&lt;/property&gt; 
          &lt;property name="hibernate.connection.username"&gt;user&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;1234&lt;/property&gt;
  
          &lt;property name="c3p0.minPoolSize"&gt;2&lt;/property&gt;
      &lt;property name="c3p0.maxPoolSize"&gt;100&lt;/property&gt;
      &lt;property name="c3p0.timeout"&gt;1000&lt;/property&gt;
      &lt;property name="hibernate.cache.use_second_level_cache"&gt;false&lt;/property&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="hibernate.connection.zeroDateTimeBehavior"&gt;convertToNull&lt;/property&gt;
  
  &lt;/session-factory&gt;
  </code></pre>
  
  <p></p>
  
  <p>Where am I going wrong???</p>
  
  <p><strong>Edited:</strong></p>
  
  <blockquote>
    <p>Note: Since "show_sql" is set to 'true' in my xml, but I am not getting any SQL query on my console.</p>
  </blockquote>