Skip to content

Commit b38bc76

Browse files
committed
HHH-17156 Skip initialization for different subtype embeddables
1 parent 32605a5 commit b38bc76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/AbstractEmbeddableInitializer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ private State determinInitialState(){
267267
// parent instance is null;
268268
return State.NULL;
269269
}
270+
else if ( !entityInitializer.getConcreteDescriptor().isTypeOrSuperType( embedded.findContainingEntityMapping() ) ) {
271+
// parent instance is of a supertype which doesn't contain this embeddable
272+
return State.NULL;
273+
}
270274
else if ( entityInitializer.isEntityInitialized() ) {
271275
// parent instance has been initialized, we do not need to inject the state
272276
return State.INJECTED;

0 commit comments

Comments
 (0)