posted 16 years ago
OK, so I don't understand your first comment about the "SELECT" but if you are using HQL, you do not need the select portion, if it was going to be "Select * from..."
Anyway, you have your Hibernate Session Factory defined in your Spring configuration. The next step is to inject the Session Factory into you DAO/Repository class. So you can either do that with a constructor or a settter. Now in your code you just call sessionFactory.getCurrentSession() to get the session and now you are good to go. Do not use the new Configuration().configure().buildSessionFactory(); you do not need to do that if you are using Spring and Spring is creating the SessionFactory for you.
Mark