This issue somehow relates to but is of much broader scope and pointing out a different aspect.
Currently Hibernate checks the not-null constraint integrity persisting any object already on the object level (which is a quite early point in time; for loading objects, this might cause analoguous problems).
The not-null XML attribute, however, is part of the <column> tag and therefore is assumed to match the characteristics of a column and not a mapped object property!
I am facing severe problems with the current behaviour, as the not-null check is performed even before
any nullSafePut() method is executed for a customized Hibernate type, or even before any the any PreInsertEventListener / PreUpdateEventListener has a chance to transform null-values for properties to non-null values for database columns.
Effectively, the flexibility to handle different nullability characteristics between columns and their mapped properties is thus reduced to zero.
That probably works.
Bulk closing stale resolved issues