0

对于 Hibernate 表的列定义,如果我不指定 not-null 或 @NotNull,可空性默认为什么?

例子:

<class name="Person" table="person">
    <id name="id" column="id" type="long"/>
    <property name="name" column="name" type="string"/>
</class>

可以为name空吗?

4

1 回答 1

0

在你的情况下name是可以为空的。

默认行为对于原始类型( 、 等)不可为intdouble,否则为可空。

于 2012-05-16T16:28:36.773 回答