Oct 11

There is a getSessionFactory() method in LocalContainerEntityManagerFactoryBean, so you can define a session factory bean in spring using the following:


<bean id="sessionFactory" 
   factory-bean="entityManagerFactory" 
   factory-method="getSessionFactory" />

written by objects \\ tags: , ,


One Response to “I’m using JPA (Hibernate) and Spring and have a EntityManagerFactory but I need a SessionFactory.”

  1. Perıt Says:

    That method actually belongs to the HibernateEntityManagerFactory object returned by the LocalContainerEntityManagerFactoryBean. Just to clear it so that people (like me :)) will look at the corrent javadoc.

Leave a Reply

You must be logged in to post a comment.