Hello,
We are migrating from Kodo (JDO) to Hibernate and when creating DDL scripts from JPA and Hibernate annotations, Hibernate SchemaExport adds NOT NULL constraints on columns in join tables.
However, we are using a legacy schema where join tables allow null columns in join tables and it is actually used - we have a lot of records where one field is null.
So far we have been using Kodo and it had no problems with it. Kodo did not create that NOT NULL constraints.
I found in Hibernate sources that it is hardcoded in method
Code:
Ejb3JoinColumn.buildJoinTableJoinColumns
with a comment
Quote:
//I break the spec, but it's for good
Is it possible to stop Hibernate from creating NOT NULL constraints? If so, could it cause other problems when reading or saving data from/to such a join table where some fields are null?
We are using Hibernate 4.2.18.