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" />
Array ( ) One Response to “I’m using JPA (Hibernate) and Spring and have a EntityManagerFactory but I need a SessionFactory.”
Leave a Reply
You must be logged in to post a comment.
March 24th, 2011 at 11:49 pm
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.