title: What is the difference between AnnotationConfiguration and Configuration in Hibernate?
body: <p>What is the difference between AnnotationConfiguration and Configuration in Hibernate? I asked this question because I am getting exception An AnnotationConfiguration instance is required to use mapping class while I am trying to get my SessionFactory using this line of code</p>
  
  <pre><code>SessionFactory sf=new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
  </code></pre>
  
  <p>But if I replace it with AnnotationConfiguration then it works fine.</p>