What's the difference between Hibernate and JPA?

前端 未结 3 2002
南笙
南笙 2021-02-12 20:18

Can someone put in perspective the difference between JPA and Hibernate. Or are these complementary concepts, to be used together?

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-12 21:13

    Update 2015: this is a very old question and a lot has changed in the past ~6 years. The JPA API's are quite feature-rich these days and I recommend using JPA since more and more tools and frameworks have aligned with it. One example is Spring Data JPA: it removes a lot of boilerplate for common tasks and is phenomenally productive:

    http://projects.spring.io/spring-data-jpa/

    Original Answer: I will echo cheng81's comments and also put in a vote for using the plain Hibernate APIs. The feature set of JPA is smaller than Hibernate's and I see no reason to handicap yourself with "pure JPA" just because it's a "standard."

提交回复
热议问题