HHH-16879 Handle parent injection in ComponentType#assemble
This commit is contained in:
parent
6d47ef5ee9
commit
02d0058eec
|
@ -691,7 +691,14 @@ public class ComponentType extends AbstractType implements CompositeTypeImplemen
|
||||||
final EmbeddableInstantiator instantiator = mappingModelPart.getEmbeddableTypeDescriptor()
|
final EmbeddableInstantiator instantiator = mappingModelPart.getEmbeddableTypeDescriptor()
|
||||||
.getRepresentationStrategy()
|
.getRepresentationStrategy()
|
||||||
.getInstantiator();
|
.getInstantiator();
|
||||||
return instantiator.instantiate( () -> assembled, session.getFactory() );
|
final Object instance = instantiator.instantiate( () -> assembled, session.getFactory() );
|
||||||
|
|
||||||
|
final PropertyAccess parentInjectionAccess = mappingModelPart.getParentInjectionAttributePropertyAccess();
|
||||||
|
if ( parentInjectionAccess != null ) {
|
||||||
|
parentInjectionAccess.getSetter().set( instance, owner );
|
||||||
|
}
|
||||||
|
|
||||||
|
return instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue