Allow fetching nested unique keys

This commit is contained in:
Fabio Massimo Ercoli 2021-11-15 05:18:28 +01:00
parent e10eaf3ef4
commit a7167e2a48
2 changed files with 2 additions and 2 deletions

View File

@ -2696,7 +2696,7 @@ public abstract class AbstractEntityPersister
private Map<SingularAttributeMapping, SingleUniqueKeyEntityLoader<?>> uniqueKeyLoadersNew;
protected SingleUniqueKeyEntityLoader<?> getUniqueKeyLoader(String attributeName) {
final SingularAttributeMapping attribute = (SingularAttributeMapping) findSubPart( attributeName );
final SingularAttributeMapping attribute = (SingularAttributeMapping) findByPath( attributeName );
final SingleUniqueKeyEntityLoader<?> existing;
if ( uniqueKeyLoadersNew == null ) {
uniqueKeyLoadersNew = new IdentityHashMap<>();

View File

@ -44,7 +44,7 @@ public class EntitySelectFetchByUniqueKeyInitializer extends EntitySelectFetchIn
return;
}
final String entityName = concreteDescriptor.getEntityName();
final String uniqueKeyPropertyName = fetchedAttribute.getBidirectionalAttributeName();
final String uniqueKeyPropertyName = fetchedAttribute.getReferencedPropertyName();
final SharedSessionContractImplementor session = rowProcessingState.getSession();