![](/img/trans.png)
[英]How to use properties notation in a Hibernate XML configuration file
[英]Hibernate Properties or configuration file to use
對於休眠項目,建議使用hibernate.properties
文件或hibernate.cfg.xml
文件。 使用什么?
並且請您也可以指定為什么使用屬性代替配置,反之亦然
最好使用哪個hibernate.properties文件或hibernate.cfg.xml文件
hibernate.properties是表示連接信息的舊方法,對於最新版本(2.0+),它已被基於XML的配置文件取代,因為它更靈活並且具有更多功能。
但是,有一個線程解釋如何將它們結合在一起,您應該看一下該線程: 如何使用hibernate.properties文件而不是hibernate.cfg.xml 。
您還應該查看Hibernate文檔http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html 3.7章。 XML配置文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.