mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-10554 - Fix NPE in dirty tracking generated code of bytecode enhanced @Embeddable entities
This commit is contained in:
parent
a69b485d1b
commit
c5104601e1
@ -448,7 +448,7 @@ private void handleCompositeField(CtClass managedCtClass, CtField persistentFiel
|
||||
// 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 void execute() {
|
||||
country.setName( "Norway" );
|
||||
EnhancerTestUtils.checkDirtyTracking( entity, "address", "address.country" );
|
||||
|
||||
address.setCountry( null );
|
||||
entity.setAddress( null );
|
||||
|
||||
}
|
||||
|
||||
protected void cleanup() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user