Skip to content

Commit

Permalink
HHH-16350 Pass correct state to pre-load events
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel authored and beikov committed Mar 30, 2023
1 parent ab91f08 commit bddfa7c
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -705,8 +705,6 @@ private void registerLoadingEntity(RowProcessingState rowProcessingState, Object
@Override
public void initializeInstance(RowProcessingState rowProcessingState) {
if ( !missing && !isInitialized ) {
preLoad( rowProcessingState );

final LazyInitializer lazyInitializer = extractLazyInitializer( entityInstance );
final SharedSessionContractImplementor session = rowProcessingState.getSession();
final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
Expand Down Expand Up @@ -798,6 +796,8 @@ private void initializeEntityInstance(Object toInitialize, RowProcessingState ro

resolvedEntityState = extractConcreteTypeStateValues( rowProcessingState );

preLoad( rowProcessingState );

if ( isPersistentAttributeInterceptable(toInitialize) ) {
PersistentAttributeInterceptor persistentAttributeInterceptor =
asPersistentAttributeInterceptable( toInitialize ).$$_hibernate_getInterceptor();
Expand Down Expand Up @@ -1076,6 +1076,7 @@ protected void preLoad(RowProcessingState rowProcessingState) {
preLoadEvent.reset();

preLoadEvent.setEntity( entityInstance )
.setState( resolvedEntityState )
.setId( entityKey.getIdentifier() )
.setPersister( concreteDescriptor );

Expand Down

0 comments on commit bddfa7c

Please sign in to comment.