title: What's the correct way to use hibernate with spring
body: <p>I recently started using hibernate and spring.</p>
  
  <p>In the beginning I was told to use the sessionFactory and openSession together with beginTransaction to do db calls.</p>
  
  <p>Later I heard about dao's so I started using it by creating an interface, implementing this interface in a class and then have this class extend HibernateDAOSupport.</p>
  
  <p>I figured this was pretty solid until a colleague told me that this way is deprecated and that I should not use the HibernateDAOSupport class. But instead work with a SessionFactory instance in my dao implementation class and an instance of that class in a new seperate service class. Since this also seemed like a good way to do it, I decided to follow this path.</p>
  
  <p>Just now I've read that this method is also deprecated with the new version of spring...
  So my question is: What on earth is the correct up-to-date way to bring hibernate and spring together??</p>
  
  <p>I've also heard talk about an entity manager, what is that about?</p>
  
  <p>I'm looking for the general way to use them, if there are any exceptions to the general rule, please also provide an example of these exceptions.</p>