HHH-10554 - Fix NPE in dirty tracking generated code of bytecode enhanced @Embeddable entities
(cherry picked from commit c5104601e1
)
This commit is contained in:
parent
ae25390006
commit
6a4128653a
|
@ -448,7 +448,7 @@ public class PersistentAttributesEnhancer extends Enhancer {
|
|||
// trigger track changes
|
||||
fieldWriter.insertAfter(
|
||||
String.format(
|
||||
"((%2$s) %1$s).%4$s(\"%1$s\", (%3$s) this);%n" +
|
||||
"if (%1$s != null) { ((%2$s) %1$s).%4$s(\"%1$s\", (%3$s) this); }%n" +
|
||||
"%5$s(\"%1$s\");",
|
||||
persistentField.getName(),
|
||||
CompositeTracker.class.getName(),
|
||||
|
|
|
@ -84,6 +84,9 @@ public class DirtyTrackingTestTask extends AbstractEnhancerTestTask {
|
|||
country.setName( "Norway" );
|
||||
EnhancerTestUtils.checkDirtyTracking( entity, "address", "address.country" );
|
||||
|
||||
address.setCountry( null );
|
||||
entity.setAddress( null );
|
||||
|
||||
}
|
||||
|
||||
protected void cleanup() {
|
||||
|
|
Loading…
Reference in New Issue