title: play 2.5, hibernate : table is not mapped
body: <p>I have been getting a exception below</p>
  
  <p>(Exception is : org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped )</p>
  
  <p>It occured when this code is called.</p>
  
  <pre><code>TypedQuery&lt;User&gt; query = jpaApi.em().createQuery("select u from User u where u.email = :email and u.secretHash = :secretHash", User.class)
              .setParameter("email", parameter.getEmail())
              .setParameter("secretHash", hashAlgorithm.hash(parameter.getPassword()));
  </code></pre>
  
  <p>but if this project is running by "actirvator start" (develop env), this exception did not occur. </p>
  
  <p>it mean ... only on Production environment i got this exception.</p>
  
  <p>how can i fix it. </p>
  
  <p>please help me.</p>
  
  <p>thanks for your help and my project information is below</p>
  
  <ul>
  <li>System environment :</li>
  </ul>
  
  <p>1) Play  : 2.5.4</p>
  
  <p>2) hibernate : 5.2.1.final</p>
  
  <ul>
  <li><p>Exception Message :</p>
  
  <p>Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped [select u from User u where u.email = :email and u.secretHash = :secretHash]
      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.(HQLQueryPlan.java:115)
      at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:77)
      at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:152)
      at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:521)
      at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:623)
      ... 52 more
  Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped
      at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:171)
      at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:91)
      at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:79)
      at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:321)
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3690)
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3579)
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:718)
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:574)
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:311)
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:259)
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:262)
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190)
      ... 58 more</p></li>
  <li><p>persistence.xml</p>
  
  <pre><code>&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
  version="2.0"&gt;
  &lt;persistence-unit name="Hoth-PersistenceUnit" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;/provider&gt;
      &lt;non-jta-data-source&gt;DefaultDS&lt;/non-jta-data-source&gt;
      &lt;properties&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL94Dialect" /&gt;
  
          &lt;property name="hibernate.show_sql" value="true" /&gt;
          &lt;property name="hibernate.format_sql" value="true" /&gt;
          &lt;property name="hibernate.use_sql_comments" value="true" /&gt;
  
          &lt;property name="hibernate.max_fetch_depth" value="5" /&gt;
  
          &lt;property name="hibernate.hbm2ddl.auto" value="update" /&gt;
  
          &lt;property name="hibernate.jdbc.batch_size" value="50" /&gt;
          &lt;property name="hibernate.jdbc.batch_versioned_data" value="true" /&gt;
          &lt;property name="hibernate.order_inserts" value="true" /&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p></li>
  <li><p>Entity Class Code </p>
  
  <pre><code>@Entity
  @Table (name = "users")
  @Getter @Setter @ToString @EqualsAndHashCode (of = "email")
  public class User {
  @Id
  private String email;
  
  @Column(name = "secret_hash")
  private String secretHash;
  
  @Column(name = "accessed_at")
  private LocalDateTime accessedAt;
  
  private String gender;
  
  @Column(name = "birth_year")
  private Integer birthYear;
  
  @Column(name = "picture_name")
  private String pictureName;
  
  @Column(name = "picture_url")
  private String pictureUrl;
  
  private String nickname;
  }
  </code></pre></li>
  </ul>