hibernate,自己写的xxx.hbm.xml文件 出现错误:
Attribute "column" must be declared for element type"property"
这是因为我是复制了hibernate.cfg.xml的头部文件
<?xmlversion='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate
Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
这个应该改为mapping的头文件就行了
<?xmlversion="1.0" encoding="UTF-8"?>
<!DOCTYPEhibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
Attribute "column" must be declared for element type"property"
这是因为我是复制了hibernate.cfg.xml的头部文件
<?xmlversion='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
<?xmlversion="1.0" encoding="UTF-8"?>
<!DOCTYPEhibernate-mapping PUBLIC
本文解决在使用Hibernate时遇到的错误:在自定义的xxx.hbm.xml文件中,元素属性column未正确声明在property元素上。通过将配置文件从hibernate.cfg.xml头部文件更改为mapping头文件,成功解决了问题。
2056

被折叠的 条评论
为什么被折叠?



