Hibernate和Spring Data JPA有什么区别? [英] What is the difference between Hibernate and Spring Data JPA
问题描述
GenericDao
自定义实现提供了一个解决方案。它也可以通过方法名称约定代表JPA查询。 使用Spring Data,您可以使用Hibernate,Eclipse Link或任何其他JPA提供程序。一个非常有趣的好处是,你可以控制交易声明性地使用 @Transactional
注释。
Spring JDBC更轻量化,对于本地查询,如果你只打算单独使用JDBC,那么最好使用Spring JDBC来处理JDBC的详细信息。
因此,Hibernate和Spring数据是互补的,而不是竞争对手。What are the main differences between Hibernate and Spring Data JPA? When should we not use Hibernate or Spring Data JPA? Also, when may Spring JDBC template perform better than Hibernate / Spring Data JPA?
Hibernate is a JPA implementation, while Spring Data JPA is a JPA Data Access Abstraction. Spring Data offers a solution to GenericDao
custom implementations. It can also generate JPA queries on your behalf through method name conventions.
With Spring Data, you may use Hibernate, Eclipse Link or any other JPA provider. A very interesting benefit is that you can control transaction boundaries declaratively using the @Transactional
annotation.
Spring JDBC is much more lightweight, and it's intended for native querying, and if you only intend to use JDBC alone, then you are better off using Spring JDBC to deal with the JDBC verbosity.
So, Hibernate,and Spring Data are complementary rather than competitors.
这篇关于Hibernate和Spring Data JPA有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!