HHH-17885 Fix for same named attribute of different Embedded uses same selection expression
This commit is contained in:
parent
62836b5dcf
commit
15fd989ff6
|
@ -302,7 +302,7 @@ public abstract class AbstractEmbeddableMapping implements EmbeddableMappingType
|
|||
scale = null;
|
||||
nullable = true;
|
||||
isLob = false;
|
||||
selectablePath = basicValue.createSelectablePath( bootPropertyDescriptor.getName() );
|
||||
selectablePath = new SelectablePath( determineEmbeddablePrefix() + bootPropertyDescriptor.getName() );
|
||||
}
|
||||
|
||||
attributeMapping = MappingModelCreationHelper.buildBasicAttributeMapping(
|
||||
|
@ -453,6 +453,14 @@ public abstract class AbstractEmbeddableMapping implements EmbeddableMappingType
|
|||
return true;
|
||||
}
|
||||
|
||||
protected String determineEmbeddablePrefix() {
|
||||
NavigableRole root = getNavigableRole().getParent();
|
||||
while ( !root.isRoot() ) {
|
||||
root = root.getParent();
|
||||
}
|
||||
return getNavigableRole().getFullPath().substring( root.getFullPath().length() + 1 ) + ".";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfFetchables() {
|
||||
return getAttributeMappings().size();
|
||||
|
|
|
@ -398,7 +398,7 @@ public class EmbeddableMappingTypeImpl extends AbstractEmbeddableMapping impleme
|
|||
scale = null;
|
||||
isLob = false;
|
||||
nullable = bootPropertyDescriptor.isOptional();
|
||||
selectablePath = basicValue.createSelectablePath( bootPropertyDescriptor.getName() );
|
||||
selectablePath = new SelectablePath( determineEmbeddablePrefix() + bootPropertyDescriptor.getName() );
|
||||
}
|
||||
attributeMapping = MappingModelCreationHelper.buildBasicAttributeMapping(
|
||||
bootPropertyDescriptor.getName(),
|
||||
|
|
|
@ -106,10 +106,6 @@ public final class NavigableRole implements DotIdentifierSequence, Serializable
|
|||
return fullPath;
|
||||
}
|
||||
|
||||
public boolean isRoot() {
|
||||
return parent == null && StringHelper.isEmpty( localName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + '[' + fullPath + ']';
|
||||
|
|
Loading…
Reference in New Issue