2018.10.5 hibernate导入约束,在Eclipse的xml文件实现自动提示
打开Java Resources/Libraries/hibernate-core-5.3.1.Final.jar/org.hibernate/hibernate-mapping-3.0.dtd(hibernate-mapping-3.0.dtd在org.hibernate包中最底下)在该文件中可找到DTD约束
解压hibernate.jar包
在org\hibernate目录下找到hibernate-configuration-3.0.dtd和hibernate-mapping-3.0.dtd
打开Eclipse-->Window-->Preferences-->Web and XML-->XML Catalog
在右边点击Add XML Catalog Entry
Key Type:URL
Key:打开dtd文件粘贴如下路径
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd
整个项目刷新一下,输入第一个文档节点就会自动提示
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class>
<id>
<generator class=""></generator>
</id>
</class>
</hibernate-mapping>