---
title: "Hibernate3映射到PostgreSQL中遇到的小问题！"
author: "DavyLee"
date: "2008-03-17T11:05:43Z"
tags: []
slug: "hibernate3-postgresql"
draft: false
lastmod: "2008-03-17T11:05:43Z"
id: 172874
url: "https://davylee.iteye.com/blog/172874"
---

前天，我用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"/>

```

但表中的确有authorId.
    后来，我把表中的字段authorId改为了authorid,映射文件不变，就一切ok了！
    另人费解，为什么column="authorId"在PostgreSQL必须对应authorid？
    不知道大家是否遇到过类似问题。