1.在网上找了好久,今天终于解决了,如果你的myeclipse自动生成的添加hibernate3jar包时,依靠通常的方法是无法关联其相应版本的源代码的,就是你在编写代码是,按住ctrl + hibernate类名查看源码,选择Attach Source ,选择你解压的源码目录,当你点击OK时,没有任何反应,这是因为使用myeclipse自动添加的jar包时,只能使用下面这种方法来关联: 如下图所示:选择myeclipse菜单项选择 myeclipse-->Preference->Myeclipse->project
Capabilities->hibernate , 此时选择相应的hibernate版本添加,例如我的是hibernate3.3如下图所示:
2.将Library Modules选择成(默认不是该模式): Hibernate 3.3 core Libraries模式,找到hibernate3.jar,展开选项,选择 Source attachment 选项双击,弹出如下图