-
Notifications
You must be signed in to change notification settings - Fork 38.5k
How can Spring 3.1 support hibernate 4 such as support Hibernate 3? [SPR-8940] #13580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Juergen Hoeller commented Good catch about "entityInterceptor" - I've added that to LocalSessionFactoryBean for Spring 3.1.1. However, with respect to event listeners, Hibernate 4.0 changed its setup approach quite radically, and the documentation on it is very sparse. The old event registration methods on the Hibernate Configuration API do not exist anymore. We'll be researching what we can do about this. Juergen |
Holger Stenzhorn commented Hi Jürgen, I do not know whether my issue is the same or related - or whether I am just not doing things correctly. ...but in order to employ Jasypt, I used the following for Hibernate3 in the ApplicationContext:
Now, in the LocalSessionFactoryBean for Hibernate 4, I cannot find the possibility to set type definitions (and there is no TypeDefinitionBean in that package as well). As a replacement, I wanted to set the type definitions in the package-info.java of the model classes package but this seems to be not working because of issue #13233. Regards, |
sreekanth commented Hi Juergen, |
Per Edlund commented Hi! Don't know if this belongs here, but I seam to get problems with hibernate4 and spring 3.1 when using the HibernateInterceptor from hibernate3 package, all other things from hibernate4 package. Is there some configuration settings needed to make the sessionfactoryutils to create the correct session? I get a signature error (classic.session) instead of session |
Juergen Hoeller commented Mixing and matching classes from the orm.hibernate3 and orm.hibernate4 packages is unfortunately not possible - due to signature changes in the Hibernate APIs, like the one that you encountered. The only thing we can do is to try to port further classes from orm.hibernate3 over to orm.hibernate4, provided that it is possible and that there is no better equivalent in the Hibernate 4 world. Juergen |
Chris Beams commented Resolved, with regard to the addition of |
Nils Breunese commented I'm converting a project from Hibernate 3 to 4. I changed the org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean to org.springframework.orm.hibernate4.LocalSessionFactoryBean, but that class doesn't have an eventListeners property. How do I proceed? |
Anson Chiew commented Hi Nilis, I am also looking for the solution. Have you found anything? |
weixing_zou commented How about this issue? it seems that it has not been resolved yet. I can not upgrade to Hibernate 4.X yet. |
Chris Beams commented I've created a new issue to address the inability to register event listeners against the hibernate 4 variant of |
Duchatelle commented For information, I found temporary solution : http://stackoverflow.com/questions/8616146/eventlisteners-using-hibernate-4-0-with-spring-3-1-0-release |
Ian Brandt commented
|
weixing_zou opened SPR-8940 and commented
I can assign entityInterceptor and eventListeners to org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean, but there is no class org.springframework.orm.hibernate4.annotation.AnnotationSessionFactoryBean, and for org.springframework.orm.hibernate4.LocalSessionFactoryBean, there is no property entityInterceptor and eventListeners.
Then how can I upgrade to Hibernate 4 with Spring 3.1 under this situation?
For example:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="entityInterceptor" ref="entityInterceptor" />
<property name="eventListeners">
<map>
...
</map>
</property>
</bean>
Affects: 3.1 GA
Issue Links:
Referenced from: commits 23a941d, eb31528
8 votes, 12 watchers
The text was updated successfully, but these errors were encountered: