HHH-16919 Always skip initialization for non-owning entity initializers
This commit is contained in:
parent
c228b5f477
commit
312431a231
|
@ -1053,6 +1053,9 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
|||
}
|
||||
|
||||
protected boolean skipInitialization(Object toInitialize, RowProcessingState rowProcessingState) {
|
||||
if ( !isOwningInitializer ) {
|
||||
return true;
|
||||
}
|
||||
final EntityEntry entry =
|
||||
rowProcessingState.getSession().getPersistenceContextInternal().getEntry( toInitialize );
|
||||
if ( entry == null ) {
|
||||
|
@ -1062,7 +1065,7 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
|||
else if ( entry.getStatus().isDeletedOrGone() ) {
|
||||
return true;
|
||||
}
|
||||
else if ( isOwningInitializer ) {
|
||||
else {
|
||||
if ( isPersistentAttributeInterceptable( toInitialize ) ) {
|
||||
final PersistentAttributeInterceptor interceptor =
|
||||
asPersistentAttributeInterceptable( toInitialize ).$$_hibernate_getInterceptor();
|
||||
|
@ -1086,9 +1089,6 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isReadOnly(RowProcessingState rowProcessingState, SharedSessionContractImplementor persistenceContext) {
|
||||
|
|
Loading…
Reference in New Issue