title: HibernatePagingItemReader throwing QuerySyntaxException table is not mapped
body: <p>I am developing using spring-boot, spring-batch application where I am reading data from source table using HibernatePagingItemReader. When I am running the code I am getting below exception. Below is my application code. Please note that my table name in database is "OLDUSER" and my entity name is "Olduser". I have already used all the possible suggestions made over stackoverflow for similar questions but none of them is working me.
  Thanks for the help. </p>
  
  <pre><code>    org.hibernate.hql.internal.ast.QuerySyntaxException: Olduser is not mapped [FROM Olduser o where o.id&gt;=7501 and o.id &lt;= 15000 order by o.id ASC]
  at org.hibernate.hql.internal.ast.QuerySyntaxException.generateQueryException(QuerySyntaxException.java:79)
  at org.hibernate.QueryException.wrapWithQueryString(QueryException.java:103)
  at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:218)
  at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142)
  at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:115)
  at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:76)
  at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150)
  </code></pre>
  
  <p><strong>Domain class : Olduser.java:-</strong></p>
  
  <pre><code>    import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.Table;
  @Table(name="OLDUSER")
  @Entity
  public class Olduser {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name="ID")
      int id;
      @Column(name="USERNAME")
      String username;
      @Column(name="PASSWORD")
      String password;
      @Column(name="AGE")
      int age;
  
      public Olduser(int id, String username, String password, int age) {
          super();
          this.id = id;
          this.username = username;
          this.password = password;
          this.age = age;
      }
  </code></pre>
  
  <p><strong>ItemReader Code :-</strong></p>
  
  <pre><code>        @Bean
  @StepScope
  public HibernatePagingItemReader&lt;Olduser&gt; hibernateUserItemReader(
          @Value("#{stepExecutionContext[fromId]}") final String fromId,
          @Value("#{stepExecutionContext[toId]}") final String toId,
          @Value("#{stepExecutionContext[name]}") final String name) throws Exception {
  
      LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
      factoryBean.setDataSource(this.dataSource);
      factoryBean.afterPropertiesSet();
      SessionFactory sessionFactory = factoryBean.getObject();
  
      HibernatePagingItemReader&lt;Olduser&gt; hibernateReader=new HibernatePagingItemReader&lt;&gt;();
      hibernateReader.setFetchSize(chunkSize);
      hibernateReader.setQueryString("FROM Olduser o where o.id&gt;=" + fromId + " and o.id &lt;= " + toId +" order by o.id ASC");
      hibernateReader.setSessionFactory(sessionFactory);
      hibernateReader.setUseStatelessSession(false);
      hibernateReader.setSaveState(false);
      hibernateReader.afterPropertiesSet();
      return hibernateReader;
  }
  </code></pre>