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

在hibernate.cfg.xml头部部分如下:

<!DOCTYPE hibernate-configuration PUBLIC  
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"  
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  1. 一、解压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文件也是这样配置即可!
posted @ 2014-02-10 00:19  无名の辈  阅读(307)  评论(1编辑  收藏  举报