org.hibernate.MappingException: column attribute may not be used together with

 下午调试代码,报这些错

 

Caused by: org.hibernate.MappingException: column attribute may not be used together with <column> subelement
at org.hibernate.cfg.HbmBinder.bindColumns(HbmBinder.java:1075)
at org.hibernate.cfg.HbmBinder.bindColumnsOrFormula(HbmBinder.java:1547)
at org.hibernate.cfg.HbmBinder.bindSimpleValue(HbmBinder.java:1143)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:413)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:356)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)
at org.hibernate.cfg.Configuration.add(Configuration.java:716)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:551)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:677)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 36 more

 

 

上网查看解决办法,说是Hibernate配置文件java.hbm.xml中property 属性中不能有<column>标签,埋头一个一个的文件找property 中的<column>去掉之后,仍然报这个错误,就纳了闷了,经过一番苦思冥想才发现<id>标签中也有<column>,果断删掉!!!

ok了!

万事大吉!!!

你可能感兴趣的:(together)