@@ -932,10 +932,7 @@ public void resolveInstance(Object instance, EntityInitializerData data) {
932932 // Entity is most probably initialized
933933 data .entityInstanceForNotify = instance ;
934934 data .concreteDescriptor = session .getEntityPersister ( null , instance );
935- resolveEntityKey (
936- data ,
937- data .concreteDescriptor .getIdentifier ( instance , session )
938- );
935+ resolveEntityKey ( data , data .concreteDescriptor .getIdentifier ( instance , session ) );
939936 data .entityHolder = persistenceContext .getEntityHolder ( data .entityKey );
940937 if ( data .entityHolder == null ) {
941938 // Entity was most probably removed in the same session without setting this association to null.
@@ -950,7 +947,8 @@ public void resolveInstance(Object instance, EntityInitializerData data) {
950947 }
951948 if ( data .concreteDescriptor .getBytecodeEnhancementMetadata ().isEnhancedForLazyLoading ()
952949 && isPersistentAttributeInterceptable ( data .entityInstanceForNotify )
953- && getAttributeInterceptor ( data .entityInstanceForNotify ) instanceof EnhancementAsProxyLazinessInterceptor enhancementInterceptor
950+ && getAttributeInterceptor ( data .entityInstanceForNotify )
951+ instanceof EnhancementAsProxyLazinessInterceptor enhancementInterceptor
954952 && !enhancementInterceptor .isInitialized () ) {
955953 data .setState ( State .RESOLVED );
956954 }
@@ -1033,14 +1031,14 @@ public void resolveInstance(EntityInitializerData data) {
10331031 }
10341032 resolveEntityKey ( data , id );
10351033 }
1036- final PersistenceContext persistenceContext = rowProcessingState . getSession ()
1037- . getPersistenceContextInternal ();
1038- data . entityHolder = persistenceContext .claimEntityHolderIfPossible (
1039- data .entityKey ,
1040- null ,
1041- rowProcessingState .getJdbcValuesSourceProcessingState (),
1042- this
1043- );
1034+ data . entityHolder =
1035+ rowProcessingState . getSession (). getPersistenceContextInternal ()
1036+ .claimEntityHolderIfPossible (
1037+ data .entityKey ,
1038+ null ,
1039+ rowProcessingState .getJdbcValuesSourceProcessingState (),
1040+ this
1041+ );
10441042
10451043 if ( useEmbeddedIdentifierInstanceAsEntity ( data ) ) {
10461044 data .setInstance ( data .entityInstanceForNotify = rowProcessingState .getEntityId () );
@@ -1078,8 +1076,9 @@ public void resolveInstance(EntityInitializerData data) {
10781076
10791077 protected void resolveEntityInstance1 (EntityInitializerData data ) {
10801078 final Object proxy = data .entityHolder .getProxy ();
1081- final boolean unwrapProxy = proxy != null && referencedModelPart instanceof ToOneAttributeMapping
1082- && ( (ToOneAttributeMapping ) referencedModelPart ).isUnwrapProxy ()
1079+ final boolean unwrapProxy = proxy != null
1080+ && referencedModelPart instanceof ToOneAttributeMapping toOneAttributeMapping
1081+ && toOneAttributeMapping .isUnwrapProxy ()
10831082 && getConcreteDescriptor ( data ).getBytecodeEnhancementMetadata ().isEnhancedForLazyLoading ();
10841083 final Object entityFromExecutionContext ;
10851084 if ( !unwrapProxy && isProxyInstance ( proxy ) ) {
@@ -1265,18 +1264,18 @@ else if ( entityDescriptor.canUseReferenceCacheEntries() ) {
12651264 }
12661265
12671266 protected Object instantiateEntity (EntityInitializerData data ) {
1268- return data .getRowProcessingState ().getSession ().instantiate (
1269- data .concreteDescriptor ,
1270- data .entityKey .getIdentifier ()
1271- );
1267+ return data .getRowProcessingState ().getSession ()
1268+ .instantiate ( data .concreteDescriptor , data .entityKey .getIdentifier () );
12721269 }
12731270
12741271 private Object resolveToOptionalInstance (EntityInitializerData data ) {
12751272 if ( isResultInitializer () ) {
12761273 // this isEntityReturn bit is just for entity loaders, not hql/criteria
12771274 final JdbcValuesSourceProcessingOptions processingOptions =
12781275 data .getRowProcessingState ().getJdbcValuesSourceProcessingState ().getProcessingOptions ();
1279- return matchesOptionalInstance ( data , processingOptions ) ? processingOptions .getEffectiveOptionalObject () : null ;
1276+ return matchesOptionalInstance ( data , processingOptions )
1277+ ? processingOptions .getEffectiveOptionalObject ()
1278+ : null ;
12801279 }
12811280 else {
12821281 return null ;
@@ -1289,8 +1288,8 @@ private boolean matchesOptionalInstance(
12891288 final Object optionalEntityInstance = processingOptions .getEffectiveOptionalObject ();
12901289 final Object requestedEntityId = processingOptions .getEffectiveOptionalId ();
12911290 return requestedEntityId != null
1292- && optionalEntityInstance != null
1293- && areKeysEqual ( requestedEntityId , data .entityKey .getIdentifier () );
1291+ && optionalEntityInstance != null
1292+ && areKeysEqual ( requestedEntityId , data .entityKey .getIdentifier () );
12941293 }
12951294
12961295 private Object resolveInstanceFromCache (EntityInitializerData data ) {
0 commit comments