【发布时间】:2017-04-17 13:47:54
【问题描述】:
Hibernate 什么都能做,为什么要引入 JPA。
【问题讨论】:
-
互联网搜索显然又被关闭了,当这种情况发生时讨厌它。
Hibernate 什么都能做,为什么要引入 JPA。
【问题讨论】:
JPA 只是规范,Hibernate 是一种实现,您可以在此问题What's the difference between JPA and Hibernate? 中找到更多详细信息。
如果您将 JPA 与 hibernate 一起使用,那么您可以将 hibernate 替换为任何其他替代 ORM。无需修改太多代码。
类似于List 接口,现在您可以根据需要使用列表的任何实现,例如LinkedList、ArrayList 等
【讨论】: