在编辑 *.hbm.xml 文件时,myeclipse 带有自动提示功能,但 eclipse 是没有自动提示功能的。需要自己手工加上:
          1、打开项目中任意一个 *.hbm.xml 文件,看一下文件头,形如以下:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  3. "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<?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 中那样拥有自动提示功能了。

在编辑 hibernate.cfg.xml 文件时,myeclipse 带有自动提示功能

和上面的配置基本一样只是将

http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd
换成

http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd

就可以了

最新文章

  1. 【转】 XenServer的架构
  2. c++ chap1 to chap 3
  3. apache 虚拟ip
  4. 【POJ 2886】Who Gets the Most Candies?
  5. Play on Words[HDU1116]
  6. [LeetCode]切割字符串,使各个子串都是回文
  7. MAVEN 工程打包resources目录外的更多资源文件
  8. 51单片机 Keil C 延时程序的简单(晶振12MHz,一个机器周期1us.)
  9. 图示CCScrollView的相关概念
  10. vs2010环境下将Win32控制台应用程序,改为Win32项目
  11. Python识别网站验证码
  12. 部署 Helm - 每天5分钟玩转 Docker 容器技术(162)
  13. 「SQL归纳」树形结构表的存储与查询功能的实现——通过路径方法(非递归)
  14. SQL: Cannot create JDBC driver of class &#39;&#39; for connect URL
  15. K8S 部署 ingress-nginx (二) 部署后端为 tomcat
  16. qhfl-1 跨域
  17. React 模板
  18. Spring 学习——Spring框架结构、概念
  19. php的isset()和empty()区别
  20. python多线程与GIL(转)

热门文章

  1. 深入学习MongoDB
  2. [AGC003F] Fraction of Fractal(矩阵乘法)
  3. 【HDOJ5975】Aninteresting game(BIT原理)
  4. android init.rc命令快速对照表
  5. 通过使用集合Properties完成JDBC的连接工具类
  6. guacamole 基本学习使用
  7. 常用的Linux系统命令
  8. APACHE 配置虚拟主机和HTTPS
  9. Codeforces 583 DIV2 GCD Table 贪心
  10. Atom打开大文件卡死的问题替代方案