您的位置:首页 > 编程语言 > Java开发

eclipse为hibernate.cfg.xml添加自动提示【转】

2014-02-10 00:19 363 查看
在hibernate.cfg.xml头部部分如下:

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">


一、解压hibernate-core-4.1.8.Final.jar文件,在org/hibernate目录下找到hibernate-configuration-3.0.dtd文件,将其copy至某个目录下,如D:\Tools\dtd\

二、window->Preferences->XML,然后展开XML,选中[XML Catalog],单机【Add】按钮,选择【Catalog Entity】,在【Location】输入框中输入hibernate-configuration-3.0.dtd文件路径,如:D:\Tools \dtd\hibernate-configuration-3.0.dtd,【Key type】选择‘URI’,【Key】则输入hibernate.cfg.xml头部中出现的‘http://www.hibernate.org /dtd/hibernate-configuration-3.0.dtd’,最后单击【ok】按钮,完成!

同理,*.hbm.xml文件也是这样配置即可!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: