HHH-16350 Pass correct state to pre-load events
This commit is contained in:
parent
ab91f08ad8
commit
bddfa7c5c6
|
@ -705,8 +705,6 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
||||||
@Override
|
@Override
|
||||||
public void initializeInstance(RowProcessingState rowProcessingState) {
|
public void initializeInstance(RowProcessingState rowProcessingState) {
|
||||||
if ( !missing && !isInitialized ) {
|
if ( !missing && !isInitialized ) {
|
||||||
preLoad( rowProcessingState );
|
|
||||||
|
|
||||||
final LazyInitializer lazyInitializer = extractLazyInitializer( entityInstance );
|
final LazyInitializer lazyInitializer = extractLazyInitializer( entityInstance );
|
||||||
final SharedSessionContractImplementor session = rowProcessingState.getSession();
|
final SharedSessionContractImplementor session = rowProcessingState.getSession();
|
||||||
final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
|
final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
|
||||||
|
@ -798,6 +796,8 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
||||||
|
|
||||||
resolvedEntityState = extractConcreteTypeStateValues( rowProcessingState );
|
resolvedEntityState = extractConcreteTypeStateValues( rowProcessingState );
|
||||||
|
|
||||||
|
preLoad( rowProcessingState );
|
||||||
|
|
||||||
if ( isPersistentAttributeInterceptable(toInitialize) ) {
|
if ( isPersistentAttributeInterceptable(toInitialize) ) {
|
||||||
PersistentAttributeInterceptor persistentAttributeInterceptor =
|
PersistentAttributeInterceptor persistentAttributeInterceptor =
|
||||||
asPersistentAttributeInterceptable( toInitialize ).$$_hibernate_getInterceptor();
|
asPersistentAttributeInterceptable( toInitialize ).$$_hibernate_getInterceptor();
|
||||||
|
@ -1076,6 +1076,7 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
||||||
preLoadEvent.reset();
|
preLoadEvent.reset();
|
||||||
|
|
||||||
preLoadEvent.setEntity( entityInstance )
|
preLoadEvent.setEntity( entityInstance )
|
||||||
|
.setState( resolvedEntityState )
|
||||||
.setId( entityKey.getIdentifier() )
|
.setId( entityKey.getIdentifier() )
|
||||||
.setPersister( concreteDescriptor );
|
.setPersister( concreteDescriptor );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue