What's the difference between Hibernate and JPA?

前端 未结 3 1998
南笙
南笙 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:20

    Hibernate is a really good solution, however its license (GPL) means it can't be used in some projects.

    JPA is a spec that supports a range of implementations including Hibernate, but also OpenJPA and other products with different characteristics.

    If you can get away with just using Hibernate, it may be worth doing so as its mature, stable and performs well. However, if you need to incorporate the persistence engine in a product that ships with a non-GPL license, you need to go the JPA route (or pay for the commercial Hibernate license).

提交回复
热议问题