HibernateTransactionManager或JpaTransactionManager

HibernateTransactionManager或JpaTransactionManager,第1张

HibernateTransactionManager或JpaTransactionManager

他希望您的代码依赖于JPA,而不是Hibernate。

javax.persistence.EntityManager
是JPA(Java
EE)标准接口,同时
org.hibernate.SessionFactory
是Hibernate专有接口。从SessionFactory移到EntityManager会使您的类不再依赖于Hibernate。如今,大多数人认为使用JPA-
way而不是Hibernate-way是最佳实践。

Please note that your system is still dependent upon Hibernate, as you need a
JPA provider. But if you want to change to another JPA provider in the future
it should be pretty straight forward. Another advantage for going for JPA is
that the JPA-interfaces are more stable than the Hibernate ones.



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4987840.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-14
下一篇 2022-11-14

发表评论

登录后才能评论

评论列表(0条)

保存