title: IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: ClassName is not mapped
body: <p>I am getting this error in Spring MVC:</p>
  <blockquote>
  <p><strong>Request processing failed; nested exception is java.lang.IllegalArgumentException:
  org.hibernate.hql.internal.ast.QuerySyntaxException: SampleClass is</strong>
  not mapped sampleClass.</p>
  </blockquote>
  <p>Below is my <code>DaoClass</code> function where I mapped <code>SampleClass</code> with <code>SampleClass</code>  table</p>
  <pre class="lang-java prettyprint-override"><code>@Autowired
  private SessionFactory sessionFactory;
  
  @Transactional
  public List&lt;SampleClass&gt; getData()
  {
     Session session = sessionFactory.getCurrentSession();
     List &lt;SampleClass&gt; sampleClass = session.createQuery(&quot;from SampleClass&quot;,SampleClass.class).list();
              
     return sampleClass;
  }
  </code></pre>
  <p>Even the table name is the same and the column name is the same as sampleClass property.</p>
  <p>In the sample class I used annotations for mapping:</p>
  <pre class="lang-java prettyprint-override"><code>@Data
  @Entity
  public class SampleClass {
      
      @Getter
      @Setter
      @Id
      private  int id;
      @Getter
      @Setter
      private String aname;
      
  }
  </code></pre>
  <p>I went through many solutions nothing resolved mine.
  Is there any issue related to dependency versions?
  One more thing <code>@Entity</code> is showing deprecated any other alternative?</p>