HHH-13552 Avoid retrieving the same Persister twice

This commit is contained in:
Sanne Grinovero 2019-08-09 15:52:54 +01:00
parent 80f8f0845c
commit 1d4d018dfa
1 changed files with 3 additions and 2 deletions

View File

@ -462,8 +462,9 @@ public abstract class CollectionType extends AbstractType implements Association
ownerId = key; ownerId = key;
} }
else { else {
Type keyType = getPersister( session ).getKeyType(); final CollectionPersister persister = getPersister( session );
EntityPersister ownerPersister = getPersister( session ).getOwnerEntityPersister(); Type keyType = persister.getKeyType();
EntityPersister ownerPersister = persister.getOwnerEntityPersister();
// TODO: Fix this so it will work for non-POJO entity mode // TODO: Fix this so it will work for non-POJO entity mode
Class ownerMappedClass = ownerPersister.getMappedClass(); Class ownerMappedClass = ownerPersister.getMappedClass();
if ( ownerMappedClass.isAssignableFrom( keyType.getReturnedClass() ) && if ( ownerMappedClass.isAssignableFrom( keyType.getReturnedClass() ) &&