• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Planning to upgrade from hibernate 4.x to 5.x

 
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am planning to upgrade from hibernate 4.x to 5.x versions

Currently am using :

org.springframework.orm.hibernate4.HibernateTransactionManager
org.springframework.orm.hibernate4.LocalSessionFactoryBean
org.springframework.orm.hibernate4.HibernateDaoSupport

I need to upgrade to

org.springframework.orm.hibernate5.HibernateTransactionManager
org.springframework.orm.hibernate5.LocalSessionFactoryBean
org.springframework.orm.hibernate5.HibernateDaoSupport

Any specific/stable version in 5.x which  I can use in my pom.xml ?



 
Saloon Keeper
Posts: 28238
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make your POM upgradeable. For example:


As you can see, I haven't updated in a while. Oh well.

Do this and you can switch versions just by changing the properties and doing a "mvn clean" and build. That way if you don't like a specific version you can easily change it without breaking the POM.
 
Santosh Kumar Nayak
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am planning to use for pom.xml artifacts

<version>5.2.9.FINAL</version>
 
Santosh Kumar Nayak
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below is code snippet




During upgrade am getting this error
incomparable types : javax.persistence.FlushModeType and org.hibernate.FlushMode

Can anyone help on it ?  

 
Tim Holloway
Saloon Keeper
Posts: 28238
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The javax.persistence package is JPA. Your logic uses "sessions", which is legacy Hibernate, not Hibernate JPA.
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic