Bytecode enhancement @OneToOne + @LazyToOne not tracked properly when set to NULL

Description

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:

Environment

None

Assignee

Ayala Goldstein

Reporter

Ayala Goldstein

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure