為 eclipse 的 hibernate 設定檔(*.hbm.xml)加上自動提示功能

來源:互聯網
上載者:User

為 eclipse 的 hibernate 設定檔(*.hbm.xml)加上自動提示功能

          在編輯 *.hbm.xml 檔案時,myeclipse 帶有自動提示功能,但 eclipse 是沒有自動提示功能的。需要自己手工加上:
          1、開啟項目中任意一個 *.hbm.xml 檔案,看一下檔案頭,形如以下:

<?xml version="1.0" encoding="utf-8"?>  <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">  

          找到
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 中那樣擁有自動提示功能了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.