Hibernate Reverse Engineering生成ORM持久化类的问题

Hibernate Reverse Engineering 生成ORM持久化类的问题

报错1:
点击"Hibernate Reverse Engineering"出现如下错误:
"This wizard generates Hibernate3.0 OR mappings(*.hbm.xml).The project your select is a Hibernate 2 project.
Execution of this wizard may produce incompatible mapping files".

解决办法:到工程根目录下,用文本编辑器打开.myhibernatedata文件,内容如下:
修改文件中的"version"的值,修改为3.1。

报错2:
出现了错误:"Path must include project and resource name:/"
解决办法:到工程根目录下,用文本编辑器打开.myhibernatedata文件,进行如下修改
libInstallFolder=/WebRoot/WEB-INF/lib 
configFile=/test/src/hibernate.cfg.xml

将"libInstallFolder"和"configFile"的内容补充完整,如果是空的,或者不存在会报以上的错误。

无法选择Java src folder
到工程根目录下找到.project这个文件。
在最后的natures中加入<nature>com.genuitec.eclipse.hibernate.hibernatenature</nature>
<natures>
  <nature>com.genuitec.eclipse.hibernate.hibernatenature</nature>
  <nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
  <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
  <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

转载来源:http://blog.csdn.net/ljhabc1982/article/details/7802822

猜你喜欢

转载自blog.csdn.net/whaosy/article/details/8191364
今日推荐