• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Pro JPA 2 - JPA for Hibernate users?

 
Ranch Hand
Posts: 38
IntelliJ IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

Like some other developer, I'm new to JPA itself but familiar enough with Hibernate API. I have used Hibernate with Hibernate EntityManager. So I have used JPA indirectly. As Hibernate implements the Java Persistence, what is the best API, I should continue mastering? Is it better to shift to pure JPA or should I continue with Hibernate? Please let me know pros and cons of using pure JPA.

Thanks,
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ayoma Wijethunga wrote:Hello!

Like some other developer, I'm new to JPA itself but familiar enough with Hibernate API. I have used Hibernate with Hibernate EntityManager. So I have used JPA indirectly. As Hibernate implements the Java Persistence, what is the best API, I should continue mastering? Is it better to shift to pure JPA or should I continue with Hibernate? Please let me know pros and cons of using pure JPA.

Thanks,



Regardless of using Hibernate, here is the answer if you are using any JPA implementation that has more than just the SPec.

1) Use the JPA spec/annotations first.
2) If JPA doesn't have a solution for your problem, then go down the the products own api and use their solution.
3) When using non JPA annotations, make sure you show the entire package structure, so that later if you ever change JPA implementations, you know which annotations (The ones with full package) that you need to change.

Hope that helps

Mark
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic