Part of the fix for HHH-12282 made nullability of join tables dependent on on {{JpaCompliance.isJpaCacheComplianceEnabled()}}.
An example is in the {{SingleTableEntityPersister}} constructor:
{code:java} isNullableTable[j] = join.isOptional() || creationContext.getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance() .isJpaCacheComplianceEnabled(); {code}
There was discussion in HHH-12282 that we were not able to come up with an example where table nullability would caused a problem when caching multi-table entities, but this change did not get reverted as part of HHH-12282.
A side-effect
----------------------------------------------------------------------------------------------------------------------------
Original description:
An entity is defined with a non-optional secondary table. After migrating from an older Hibernate release to Hibernate 5.3, encountering {{not-null}} constraint violations (database layer and in bean validation) in various scenarios for properties persisted in the secondary table.
It was discovered that the secondary table was corrupt and rows were missing for one or more entities. Hibernate did not load the invalid entity rows in older Hibernate releases. |
|