1

Hibernate 和 Spring Data JPA 之间的区别?

 1 year ago
source link: https://www.jdon.com/61115
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Hibernate 和 Spring Data JPA 之间的区别?
Hibernate是一个JPA实现,而Spring Data JPA是一个JPA数据访问抽象。

Spring Data为GenericDao的自定义实现提供了一个解决方案。它还可以通过方法名称约定代表你生成JPA查询。

通过Spring Data,你可以使用Hibernate、Eclipse Link或任何其他JPA提供者。一个非常有趣的好处是,你可以使用@Transactional注解来声明性地控制事务边界。

Spring Data JPA不是一个实现或JPA提供者,它只是一个抽象,用来大大减少为各种持久化存储实现数据访问层所需的模板代码量。

Hibernate提供了一个Java持久化API的参考实现,这使得它成为一个具有松散耦合优势的ORM工具的绝佳选择。

记住,Spring Data JPA总是需要Hibernate或Eclipse Link等JPA提供者。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK