I have a competition with this map of an embeddable entity
Here is the embedded entity
I don't care whether the fetch from the database represents an empty Participant as NULL or an object with null values, but when later saving changes to this entity, if there is a unique constraint on Side and Competition ID (one participant per side), we get an error because the generated SQL attempts to insert for that side rather than UPDATE.
hibernate-core 5.2.5, h2 and mysql
I had to write this workaround to NULL out any values where all the fields were null, but bad data in the database can still cause the issue
this is loosely caused by the inability of hibernate to know that the competition has a participant because the participant row has all null values
Please see HHH-11883.