• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it easy to change Hibernate to JPA in an application that uses Spring?

 
Ranch Hand
Posts: 701
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'd like to know if it is easy to change Hibernate to JPA in an application that uses Spring.

Thank you
 
author
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The short answer to your question is: sure! One of the missions of Spring's persistence/ORM support is portability, meaning it helps to decouple your selected persistence framework, making a transition to a different strategy far simpler. To help support this portability, Spring provides a generic exception hierarchy (allowing you to handle exceptional conditions without being tied to a persistence framework's classes), a generic transaction strategy, and a consistent approach for querying, batching, updating, etc.

Of course, when you are talking about moving from Hibernate to JPA, the transition is much simpler since these two technologies are very much related. In fact, we discuss JPA in our book, along with the question of when it makes sense to use JPA and when it is better to use Hibernate. We typically recommend the JPA annotations, whenever possible, but some of these "rules" are a bit application-specific.

Thanks for your question, and I look forward to hearing from you soon.

Best Regards,

Paul Tepper Fisher, author Spring Persistence with Hibernate
 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...what are the most common reasons one, or better a team, would
need to make this change?

Gian
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that this rarely happens, but it might happen during development, when it has been decided that an application should finally use common specifications instead of proprietary frameworks. I've never seen such a change though.
 
Gian Franco
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Christopher,

...that's what I think as well, I've seen this type of changes
happen sporadically and for very exceptional cases...and it
often entails a serious migration project.

Gian
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic