|
When using hbm2ddl into h2 on a Java property defined as "int propertyName" and with HBM entry <property name="propertyName"/> this emits an SQL column type of "propertyName integer" which is implicitly NULLable. The HBM is hibernate-mapping-3.0.dtd and in the schema it has a default of not-null="true" when the attribute is not explicitly set, but this is not honoured during DDL generation.
The bug here is that the SQL should be "propertyName integer not null".
Adding into HBM not-null="true" does fix the issue.
|