Specify the default value in the Hibernate XML configuration file

I configure Hibernate through a mapping configuration file.

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

How to set age to nullable and default to null?

+7
source share
1 answer
 <property name="age" type="integer"> <column name="age" not-null="false" default="null" /> </property> 
+15
source

All Articles