轉自:https://blog.csdn.net/u012217085/article/details/17397843?utm_source=blogkpcl3
1.
在編輯 *.hbm.xml 文件時,myeclipse 帶有自動提示功能,但 eclipse 是沒有自動提示功能的。需要自己手工加上:
1、打開項目中任意一個 *.hbm.xml 文件,看一下文件頭,形如以下:
找到 http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd(視 hibernate 版本不同有所不同,作者使用的是 hibernate3.6.7)。
2、將項目中用到的 hibernate3.jar 解壓縮,找到解壓縮后的 org 文件下的 hibernate 文件下的 hibernate-mapping-3.0.dtd 文件。
3、eclipse -> Window -> Preferences -> Web and XML -> XML Catalog,選擇 XML Catalog Entries 的 Add... 按鈕,在彈出的 Add XML Catalog Entry 對話框里,Location 里選擇第二步里得到的 hibernate-mapping-3.0.dtd,Key Type 選擇 URI,Key 里輸入第一步里得到的http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd
OK。
再打開 eclipse 中的 *.hbm.xml 文件,編輯時就可以像 myeclipse 中那樣擁有自動提示功能了。