Myeclipse生成pojo报错处理

今天生成数据库对应的javabean,切换到Database Explorer 后,选择表后点 Hibernate Reverse Engineering,然后就出来下边这个提示信息.点ok后生成不了文件.

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配置文件

#MyEclipse Hibernate Properties
#Sat Sep 22 10:42:28 CST 2012
sessionFactoryName=
genBasicCompId=false
profile=
daoSFId=
version=3.1 (修改此处这里要和你的hibernate的一致)
jndiPath=
detectM2M=false
reStrategyClass=
detectO2O=false
springDaoFile=
useJavaTypes=true
keyGenerator=
libInstallFolder=
addLibs2Project=false
genVersionTag=false
sessionFactoryId=
basePersistenceClass=
genAnnotations=false
reSettingsFile=
configFile=
createConfigFile=false
addLibs2Classpath=false

 

不过上述的方法未必有效,可以打开Navigator视图,删除.myhibernatedata配置文件,修改.project配置,

<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>
  <nature>com.sysdeo.eclipse.tomcat.tomcatnature</nature>
  <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
 </natures>

 

将上面的红色部分去掉,然后点击你的项目,右键myeclipse --> Add hibernate capabilities...  重新导一次,当然里面所有生产的东西,能不要就不要,因为我们已经有hibernate相关的包,只是为了更新下我们的myeclipse生产hibernate的相关配置而已

 

如果还有问题,可以发邮件到[email protected] ^^

你可能感兴趣的:(Myeclipse生成pojo报错处理)