title: org.hibernate.hql.internal.ast.QuerySyntaxException
body: <p>I am getting this error:</p>
  
  <pre><code>Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: TblEmployee is not mapped [FROM TblEmployee]
      Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: TblEmployee` is not mapped
  </code></pre>
  
  <p>I researched the internet and it says I am not using the class name but the table name.  I made sure I am doing this correctly.  I am trying to connect to a sql server db.</p>
  
  <p>JPA:</p>
  
  <pre><code>package com.ray.adtf.jpa;
  
  import java.io.Serializable;
  import javax.persistence.*;
  import java.sql.Timestamp;
  /**
   * The persistent class for the tblEmployee database table.
   */
  
  @Entity
  @Table(name="tblEmployee")
  @NamedQuery(name="TblEmployee.findAll", query="SELECT t FROM TblEmployee t")
  public class TblEmployee implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Id
      @Column(name="EmployeeID")
      private int employeeID;
  </code></pre>
  
  <p>ejbpackage </p>
  
  <pre><code>com.ray.adtf.ejb;
  
  import javax.ejb.Stateless;
  import javax.persistence.EntityManager;
  import javax.persistence.PersistenceContext;
  import com.ray.adtf.jpa.TblEmployee;
  import java.util.List;
  
  @Stateless
  public class GridMasterBean {
  
      @PersistenceContext
      private EntityManager em;
  
          public List&lt;TblEmployee&gt; getDisplayGridList() {
              return em.createQuery("select t FROM TblEmployee t", TblEmployee.class).getResultList();
  
      }
  </code></pre>
  
  <p>persistence.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;persistence version="1.0" 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_1_0.xsd"&gt;
   &lt;persistence-unit name="Test-Persistence" transaction-type="RESOURCE_LOCAL"&gt;
   &lt;jta-data-source&gt;java:/ProgramHierarchy&lt;/jta-data-source&gt;
   &lt;class&gt;com.ray.adtf.jpa.TblEmployee&lt;/class&gt;
   &lt;class&gt;com.ray.adtf.jpa.TblProgram&lt;/class&gt;
   &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
   &lt;/persistence-unit&gt;
   &lt;/persistence&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>