diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java index e51e643beb..26c54cb261 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java @@ -3813,7 +3813,10 @@ public abstract class BaseSqmToSqlAstConverter extends Base BiConsumer 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 ) {