Results 1 to 2 of 2

Thread: Why to use Hibernate with JPA when using Spring?

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Posts
    3

    Default Why to use Hibernate with JPA when using Spring?

    Hello,

    I'm currently learning how to use Spring.

    I want to use JPA with Spring. All examples I have seen on the web are using Hibernate as Entity Manager. Is this really necessary? Or is this considered as best practice?

    Can you tell me which dependencies (best based on Maven) are necessary to use JPA with Spring?

    Thanks for your answers.

    Kind regards,
    Chris

  2. #2
    Join Date
    Dec 2008
    Location
    New York City
    Posts
    134

    Default

    Quote Originally Posted by charms View Post
    Hello,

    I'm currently learning how to use Spring.

    I want to use JPA with Spring. All examples I have seen on the web are using Hibernate as Entity Manager. Is this really necessary? Or is this considered as best practice?

    Can you tell me which dependencies (best based on Maven) are necessary to use JPA with Spring?

    Thanks for your answers.

    Kind regards,
    Chris
    You can use whatever JPA Provider you choose. Hibernate is common to see examples of because it's the most widely used. But OpenJPA, EclipseLink, or DataNucleus should all work fine. And each has their own subtle differences. Different query generation. Different handling of @Lob. Different caching. etc...

    Cheers,
    -Andy
    Andrew Thompson - Linked In

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •