HHH-16061 SqmDynamicInstantiation warns about dynamic Map instantiation when using an entity

This commit is contained in:
Andrea Boriero 2023-01-19 16:02:28 +01:00 committed by Andrea Boriero
parent e6b94398de
commit 01db71c272
1 changed files with 9 additions and 7 deletions

View File

@ -171,13 +171,15 @@ public class SqmDynamicInstantiation<T>
}
else if ( instantiationTarget.getNature() == MAP ) {
// must(?) have an alias...
log.warnf(
"Argument [%s] for dynamic Map instantiation did not declare an 'injection alias' [%s] " +
"but such aliases are needed for dynamic Map instantiations; " +
"will likely cause problems later translating sqm",
argument.getSelectableNode().asLoggableText(),
argument.getAlias()
);
if ( argument.getAlias() == null ) {
log.warnf(
"Argument [%s] for dynamic Map instantiation did not declare an 'injection alias' [%s] " +
"but such aliases are needed for dynamic Map instantiations; " +
"will likely cause problems later translating sqm",
argument.getSelectableNode().asLoggableText(),
argument.getAlias()
);
}
}
if ( arguments == null ) {