title: hibernate 5 org.hibernate.hql.internal.ast.QuerySyntaxException: Emplooye is not mapped
body: <p>I migrated my application from hibernate 4 to 5 , Now I can see Query is deprecated .</p>
  <p>I ran my code with existing HQL implementation. It failed in runtime.</p>
  <p>Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Employee is not mapped.</p>
  <pre><code>Query query = session.createQuery(&quot;SELECT employee FROM Employee employee WHERE a = ? and b= ?&quot;);
        query = query.setParameter(0, a);
        query = query.setParameter(1, b);
        List&lt;Employee &gt; resultList = query.list();
  </code></pre>
  <p>Can someone help me to solve this issue.
  I tried to remove deprecated Query interface and used with Query also.
  But it not solve problem.</p>
  <pre><code>public class HibernateUtil {
  
      private static Logger logger = LoggerFactory.getLogger(HibernateUtil.class);
  
      private static SessionFactory sessionFactory;
      private static Properties aProp = new Properties();
  
      static {
          try (InputStream is = ClassLoader.class.getResourceAsStream(&quot;/&quot;
                  + CrasConstants.PROPERTIES_PATH);) {
              aProp.load(is);
              String filepath = aProp
                      .getProperty(CrasConstants.HIBERNATE_PROPERTIES_PATH);
              String path = FilenameUtils.normalize(filepath);
              try (InputStream hibernatePropertyfile = new FileInputStream(path
                      + &quot;hibernate.properties&quot;)) {
                  aProp.load(hibernatePropertyfile);
              }
              // configuration for encryption/decryption
              Configuration configuration = new Configuration();
              configuration.configure(&quot;hibernate.cfg.xml&quot;)
                      .addProperties(aProp);
  
              StandardPBEStringEncryptor strongEncryptor = new StandardPBEStringEncryptor();
              strongEncryptor.setProvider(new BouncyCastleProvider());
              strongEncryptor.setAlgorithm(&quot;PBEWITHSHA256AND256BITAES-CBC-BC&quot;);
              strongEncryptor.setPassword(&quot;pwd&quot;);
              HibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry
                      .getInstance();
              registry.registerPBEStringEncryptor(
                      &quot;configurationHibernateEncryptor&quot;, strongEncryptor);
              PBEStringEncryptor encryptor = registry
                      .getPBEStringEncryptor(&quot;configurationHibernateEncryptor&quot;);
              configuration.setProperty(&quot;hibernate.connection.password&quot;,
                      encryptor.decrypt(configuration
                              .getProperty(&quot;hibernate.connection.password&quot;)));
  
              ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
                      .applySettings(configuration.getProperties()).build();
  
              sessionFactory = configuration.buildSessionFactory(serviceRegistry);
          } catch (HibernateException | IOException e) {
              logger.error(e);
              System.exit(-1);
          }
          logger.info(&quot;HibernateUtil: Sessionfactory Initialized!!! &quot;);
  
      }
  
      
      public static SessionFactory getSessionFactory() {
          return sessionFactory;
      }
  }
      
  Session session = null;
      Transaction tx = null;
      List&lt;Employee&gt; requestResultList =
          new ArrayList&lt;&gt;();
      try {
        SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
        session = sessionFactory.getCurrentSession();
        tx = session.beginTransaction();
        Query query = session.createQuery(&quot;SELECT d FROM com.skf.model.Employee 
     d where d.name=:name&quot;);
        List&lt;Employee&gt; resultList = query.list();
  
  
  
  
  Employee 
  @Data
  @Entity
  @Table(name = &quot;EMPLOYEE&quot;)
  public class Employee {
  
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = &quot;EMPLOYEE_SEQ&quot;)
    @SequenceGenerator(name = &quot;EMPLOYEE_SEQ&quot;, sequenceName = &quot;EMPLOYEE_SEQ&quot;,allocationSize = 1)
    @Column(name = &quot;EMP_ID&quot;)
    private long empId;
    @Column(name = &quot;name&quot;, nullable = false)
    private String name;
  }
  </code></pre>
  <p>hibernate cfg file</p>
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
          &quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot;
          &quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
              &lt;!-- Database connection settings --&gt;
          &lt;property name=&quot;connection.provider_class&quot;&gt;
              net.lizalab.util.jasypt.h4.ext.connectionprovider.EncryptedDriverManagerConnectionProviderImpl
          &lt;/property&gt;
          &lt;property name=&quot;connection.encryptor_registered_name&quot;&gt;configurationHibernateEncryptor&lt;/property&gt;
          
          &lt;!-- &lt;property name=&quot;hibernate.connection.datasource&quot;&gt;java:comp/env/jdbc/cras&lt;/property&gt; --&gt;
          &lt;property name=&quot;connection.driver_class&quot;&gt;${hibernate.connection.driver_class}&lt;/property&gt;    
          &lt;property name=&quot;connection.url&quot;&gt;${hibernate.connection.url}&lt;/property&gt;
          &lt;property name=&quot;connection.username&quot;&gt;${hibernate.connection.username}&lt;/property&gt;
          &lt;property name=&quot;connection.password&quot;&gt;${hibernate.connection.password}&lt;/property&gt;
  
          &lt;!-- SQL dialect --&gt;
          &lt;property name=&quot;dialect&quot;&gt;org.hibernate.dialect.Oracle10gDialect&lt;/property&gt;
  
          &lt;!-- jdbc driver hint for number of fetched rows for select statement --&gt;
          &lt;property name=&quot;hibernate.jdbc.fetch_size&quot;&gt;1000&lt;/property&gt;
  
          &lt;!-- improve app startup performance --&gt;
          &lt;property name=&quot;hibernate.temp.use_jdbc_metadata_defaults&quot;&gt;false&lt;/property&gt; 
  
          &lt;property name=&quot;hibernate.cache.use_second_level_cache&quot;&gt;false&lt;/property&gt;
  
          &lt;!-- Enable Hibernate's automatic session context management --&gt;
          &lt;property name=&quot;hibernate.current_session_context_class&quot;&gt;thread&lt;/property&gt;
  
          &lt;!-- Disable the second-level cache --&gt;
          &lt;property name=&quot;cache.provider_class&quot;&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt;
  
          &lt;!-- Echo all executed SQL to stdout --&gt;
          &lt;property name=&quot;show_sql&quot;&gt;true&lt;/property&gt;
  
          &lt;property name=&quot;hbm2ddl.auto&quot;&gt;validate&lt;/property&gt;
          
          &lt;mapping class=&quot;com.skf.model.Employee&quot; /&gt;
          
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>