hibernate.properties vs hibernate.cfg.xml

时间:2011-06-26 14:17:22

标签: hibernate configuration

hibernate.properties和hibernate.cfg.xml之间的优先顺序是什么?

据我所知,hibernate.cfg.xml(如果存在于app的类路径中)会覆盖hibernate.properties。我的假设是否正确?

谢谢

1 个答案:

答案 0 :(得分:13)

来自documentation

  

另一种配置方法是在名为hibernate.cfg.xml的文件中指定完整配置。此文件可用作hibernate.properties文件的替代文件,如果两者都存在,则可用作,以覆盖属性。

相关问题