0

我是hibernate的新手,在编写一个.hbm文件时,我想到了几个问题,并将它们发布在SO上希望得到答案

问:我们将 pojo 的属性映射到 db 字段

<property name="birth_dt" type="date"> <column name="BIRTH_DATE" length="4" /> </property>

属性标签内的类型属性如何帮助/不帮助以及类型为“日期”和“java.util.Date”之间的区别是什么?列标签内的长度属性如何帮助/不帮助?

我想了解的是:这些属性有什么用

TIA

4

1 回答 1

0

Type: it is the type from the Hibernate type system. You may, for instance, use a custom type here. When mapping a basic value type, there is no difference between specifying the java type name or the Hibernate type, see the reference documentation.

Length: it is used for schema generation for data types which support a length, like varchar.

于 2012-07-10T10:19:32.997 回答