When using bytecode enhancement and @OneToOne with @LazyToOne(value = LazyToOneOption.NO_PROXY) the lazily initialized entities are not tracked properly when set value to null.
The issue happens only when the setter for the property is called before the getter for that property.
the content of the setter is comparing between the old value to the new one , and if they are not equal - the new value is tracked.
if we didn’t fetch the value (by calling the getter) - the original value = NULL, and so if we want to reset the property value by set NULL - the Objects.deepEquals in the setter return true and the property will not be tracked as dirty and will not be updated in DB on the commit .
see similar issue: