Hibernate3映射到PostgreSQL中遇到的小问题!

    技术2022-05-12  47

    前天,我用Hibernate3在PostgreSQL下写了个对一个简单对象(Tag)的CRUD操作,并按照Tag.hbm.xml映射,在 Linux下的PostgreSQL里建好了表,PostgreSQL版本不详。但启动服务后日志报错,说authorId找不到,我的 Tag.hbm.xml里写的是 Xml代码  <property name="authorId" column="authorId" type="integer" not-null="false" length="10"/>   <property name="authorId" column="authorId" type="integer" not-null="false" length="10"/> 但表中的确有authorId. 后来,我把表中的字段authorId改为了authorid,映射文件不变,就一切ok了! 另人费解,为什么column="authorId"在PostgreSQL必须对应authorid? 不知道大家是否遇到过类似问题。 

    最新回复(0)