Fix using wrong vale mapping for paramter binging with EntityCollectionPart

This commit is contained in:
Andrea Boriero 2021-11-11 11:03:37 +01:00 committed by Christian Beikov
parent 411355852a
commit d33200b309
1 changed files with 4 additions and 1 deletions

View File

@ -3813,7 +3813,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
BiConsumer<Integer,JdbcParameter> jdbcParameterConsumer) {
sqmParameterMappingModelTypes.put( expression, valueMapping );
final Bindable bindable;
if ( valueMapping instanceof Association ) {
if( valueMapping instanceof EntityCollectionPart){
bindable = ((EntityCollectionPart)valueMapping).getKeyTargetMatchPart();
}
else if ( valueMapping instanceof Association ) {
bindable = ( (Association) valueMapping ).getForeignKeyDescriptor();
}
else if ( valueMapping instanceof EntityMappingType ) {