Fix resolving id columns for NativeQuery with inplicit joins and aliases

This commit is contained in:
Andrea Boriero 2021-11-29 18:37:03 +01:00 committed by Christian Beikov
parent 91cc3d8d51
commit 0fd83cf649
1 changed files with 7 additions and 2 deletions

View File

@ -345,9 +345,14 @@ public class DomainResultCreationStateImpl
relativePathStack.push( relativePath );
}
try {
final FetchBuilder explicitFetchBuilder = fetchBuilderResolverStack
String fullPath = relativePath.getFullPath();
if ( fullPath.contains( EntityIdentifierMapping.ROLE_LOCAL_NAME ) ) {
fullPath = fullPath.replace( EntityIdentifierMapping.ROLE_LOCAL_NAME + ".", "" );
}
FetchBuilder explicitFetchBuilder = fetchBuilderResolverStack
.getCurrent()
.apply( relativePath.getFullPath() );
.apply( fullPath );
final FetchBuilder fetchBuilder;
if ( explicitFetchBuilder != null ) {
fetchBuilder = explicitFetchBuilder;