title: hibernate Error : java.lang.ClassCastException: org.hibernate.impl.QueryImpl cannot be cast to javax.persistence.Query
body: <p>i try to devlope a small application with java and hibernate, when i run the test class of this application i get this error message:</p>
  
  <pre><code>SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
  SLF4J: Defaulting to no-operation (NOP) logger implementation
  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
  Hibernate: insert into REUNION (TITREREUNION, DATEREUNION) values (?, ?)
  Hibernate: insert into REUNION (TITREREUNION, DATEREUNION) values (?, ?)
  Hibernate: insert into REUNION (TITREREUNION, DATEREUNION) values (?, ?)
  Exception in thread "main" java.lang.ClassCastException: org.hibernate.impl.QueryImpl     cannot be cast to javax.persistence.Query
  at metier.MetierImpl.getAllReunion(MetierImpl.java:62)
  at Test.main(Test.java:21)
  </code></pre>
  
  <p>as you see the error is class MetierImpl : the method that cause the error is :</p>
  
  <pre><code> public Reunion getAllReunion(){
  
      Session session =sessionFactory.getCurrentSession();
      session.beginTransaction();
      Query req=(Query) session.createQuery("select R  from Reunion ");
      List&lt;Reunion&gt; list = req.getResultList();
      Reunion r=(Reunion) req.getResultList().get(0);
  
      return r;
  
  
  }
  </code></pre>