Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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: 24595
168
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: 24595
168
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic