title: org.hibernate.hql.internal.ast.QuerySyntaxException: ContactEntity is not mapped [select c from ContactEntity c]
body: <p>I am new to hibernate and trying to configure the <strong>JPA console</strong> in an eclipse to have some research on JPAQL. I followed <a href="https://www.youtube.com/watch?v=50Hx3N_a9as" rel="nofollow noreferrer">https://www.youtube.com/watch?v=50Hx3N_a9as</a> and setup the <code>JPA console</code> by downloading <code>JBoss Hibernate tool</code> successfully. </p>
  
  <p>Note: I am using <code>Oracle DB</code>. In Database I've many schemas, out of those I want to use <code>Admin schema</code>.</p>
  
  <p>But when I tried to execute simple JPQL I see below error:</p>
  
  <pre><code>org.hibernate.hql.internal.ast.QuerySyntaxException: ContactEntity is not mapped [select c from ContactEntity c]
      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)
      at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302)
      at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240)
      at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1907)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.jboss.tools.hibernate.runtime.common.Util.invokeMethod(Util.java:43)
      at org.jboss.tools.hibernate.runtime.common.AbstractSessionFacade.createQuery(AbstractSessionFacade.java:47)
      at org.hibernate.eclipse.console.common.HQLQueryPage.setSession(HQLQueryPage.java:133)
      at org.hibernate.eclipse.console.common.HibernateExtension$2.execute(HibernateExtension.java:115)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
      at org.hibernate.eclipse.console.common.HibernateExtension.execute(HibernateExtension.java:189)
      at org.hibernate.eclipse.console.common.HibernateExtension.executeHQLQuery(HibernateExtension.java:111)
      at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:306)
      at org.hibernate.eclipse.hqleditor.HQLEditor.executeQuery(HQLEditor.java:447)
      at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:88)
      at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:55)
      at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
      at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:59)
      at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
      at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
      at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
      at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
      at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
      at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
      at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
  Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: ContactEntity 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:3704)
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3593)
      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)
      ... 53 more
  </code></pre>
  
  <p>I tried to apply many links from github but none of them worked for me. Any pointers?</p>
  
  <p><a href="https://i.stack.imgur.com/XCSqR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XCSqR.png" alt="enter image description here"></a></p>
  
  <p><strong>persistance.xml</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
          &lt;persistence-unit name="conn" transaction-type="RESOURCE_LOCAL"&gt;
                 &lt;class&gt;com.XXX.XXX.ContactEntity&lt;/class&gt;
                  &lt;class&gt;com.XXX.XXX.StudentEntity&lt;/class&gt;
                  &lt;class&gt;com.XXX.XXX.AddressEntity&lt;/class&gt;
              &lt;properties&gt;
                  &lt;property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:test"/&gt;
                  &lt;property name="javax.persistence.jdbc.user" value="test"/&gt;
                  &lt;property name="javax.persistence.jdbc.password" value="test"/&gt;
                  &lt;property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/&gt;
              &lt;/properties&gt;
          &lt;/persistence-unit&gt;
      &lt;/persistence&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ykKh4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ykKh4.png" alt="enter image description here"></a></p>
  
  <pre><code>@Entity
  @Table(name = ADM_CONTACT")
  public class ContactEntity implements Serializable {
      ............
  }
  </code></pre>