vivion32 发表于 2016-11-20 09:12:30

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

前天,我用Hibernate3在PostgreSQL下写了个对一个简单对象(Tag)的CRUD操作,并按照Tag.hbm.xml映射,在Linux下的PostgreSQL里建好了表,PostgreSQL版本不详。但启动服务后日志报错,说authorId找不到,我的Tag.hbm.xml里写的是

<property name="authorId" column="authorId" type="integer" not-null="false" length="10"/>

但表中的确有authorId.
    后来,我把表中的字段authorId改为了authorid,映射文件不变,就一切ok了!
    另人费解,为什么column="authorId"在PostgreSQL必须对应authorid?
    不知道大家是否遇到过类似问题。
页: [1]
查看完整版本: Hibernate3映射到PostgreSQL中遇到的小问题!