简体   繁体   English

春天的持久性XML

[英]spring persistence xml

What is the difference between: 之间有什么区别?

persistenc.xml can be configured with hibernate properties OR Javax.persistence properties. 可以使用休眠属性或Javax.persistence属性配置persistenc.xml。

What scenarios would you use either one. 您将使用哪种方案。

I tried using javax.persistence but my spring app would not work.. changed it to hibernate and it started working. 我尝试使用javax.persistence,但我的spring应用程序无法工作..将其更改为休眠状态并开始工作。

javax.persistence is the standard. javax.persistence是标准。 Hibernate is an implementation. Hibernate是一个实现。 If you are completely sure that your DB layer will always be handled by Hibernate, go ahead and configure using Hibernate. 如果您完全确定数据库层将始终由Hibernate处理,请继续并使用Hibernate进行配置。 If not, use javax.persistence, so that you could change your DB layer in the future. 如果不是,请使用javax.persistence,以便将来可以更改数据库层。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM