title: findAll() method is giving the empty result set in Hibernate
body: <p>In hibernate I used <code>findById()</code> and <code>findAll()</code> in Dao layer.<code>findById()</code> method working as I expected, but <code>findAll()</code> always returns empty result set,I still couldn't figure out the reason, any one could help me to solve this issue,</p>
  
  <p>Note: There is no exception, returns only empty list</p>
  
  <p>Here is my code</p>
  
  <p>Find All method</p>
  
  <pre><code> public List&lt;T&gt; findAll() {
          Query query = getSession().createQuery("SELECT obj FROM " + persistentClass.getSimpleName() + " obj");
          return query.list()
      }
  </code></pre>
  
  <p>Find by Id method</p>
  
  <pre><code>public T findById(Long id) {
          T result = (T) getSession().get(getPersistentClass(), id);
          return result;
      }
  </code></pre>
  
  <p>getSession method</p>
  
  <pre><code>protected Session getSession() {
          if (session == null)
              session = tenantBasedSessionFactory.getTenantBasedSession("tenantId");
  //            throw new IllegalStateException("Session has not been set on DAO before usage");
          return session;
      }
  </code></pre>
  
  <p>Thank you in advance 
  Cheers</p>