# Possible change in collection parameter handling between Hibernate 6.2.6.Final and 6.2.25.Final

**URL:** <https://discourse.hibernate.org/t/possible-change-in-collection-parameter-handling-between-hibernate-6-2-6-final-and-6-2-25-final/12435>\
**Category:** Hibernate ORM\
**Created:** [September 21, 2026, 9:29am UTC](https://discourse.hibernate.org/t/possible-change-in-collection-parameter-handling-between-hibernate-6-2-6-final-and-6-2-25-final/12435 "2026-09-21T09:29:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhilsb97](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@akhilsb97](https://discourse.hibernate.org/u/akhilsb97)\
**Post date:** [September 21, 2026, 9:29am UTC](https://discourse.hibernate.org/t/possible-change-in-collection-parameter-handling-between-hibernate-6-2-6-final-and-6-2-25-final/12435/1 "2026-09-21T09:29:42Z")

</div>

Hi,

I am getting the following exception after upgrading my dependencies:

org.hibernate.QueryException:  
Named parameter not bound : types\_1

The exception occurs while executing a paginated query. The stack trace goes through:

org.springframework.data.jpa.repository.query.JpaQueryExecution$PagedExecution.count

The relevant versions are:

Working:  
Spring Boot 3.1.2  
Spring Data JPA 3.1.2  
Hibernate 6.2.6.Final

Failing:  
Spring Boot 3.1.12  
Spring Data JPA 3.1.12  
Hibernate 6.2.25.Final

When I revert to the older Spring Boot/Hibernate dependency versions, the issue does not occur.

The query contains an optional collection parameter similar to:

AND (  
COALESCE(:types) IS NULL  
OR entity.type IN (:types)  
)

where `types` is a `Set<String>`.

The query works with Hibernate 6.2.6.Final but fails with Hibernate 6.2.25.Final.

I understand that collection parameters are normally used with:

entity.type IN (:types)

I also found discussions indicating that list parameters should not be used with `COALESCE()` or `IS NULL`.

My questions are:

1. Is using a collection-valued parameter with `COALESCE()` unsupported in Hibernate 6.x?

2. Were there any relevant changes between Hibernate 6.2.6.Final and 6.2.25.Final regarding collection parameter binding?

3. Could this behavior be related to the pagination count query?

4. Could the change in Spring Boot / Spring Data JPA versions also be involved?

5. What is the recommended way to handle an optional collection parameter in JPQL?

I am trying to determine whether this is caused by a change in Hibernate, Spring Data JPA, or simply an unsupported query pattern that happened to work with the older dependency versions.

Thanks!

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [September 21, 2026, 1:28pm UTC](https://discourse.hibernate.org/t/possible-change-in-collection-parameter-handling-between-hibernate-6-2-6-final-and-6-2-25-final/12435/2 "2026-09-21T13:28:34Z")

</div>

> [@akhilsb97](#):
>
> 1. Is using a collection-valued parameter with `COALESCE()` unsupported in Hibernate 6.x?

It never was supported and only worked coincidentally.

> [@akhilsb97](#):
>
> 1. Were there any relevant changes between Hibernate 6.2.6.Final and 6.2.25.Final regarding collection parameter binding?

Check the changelogs or commits on GitHub to see for yourself.

> [@akhilsb97](#):
>
> 1. Could this behavior be related to the pagination count query?

Maybe, depends what pagination count query you are using.

> [@akhilsb97](#):
>
> 1. Could the change in Spring Boot / Spring Data JPA versions also be involved?

I have no idea what Spring does here, so yeah, for all I can say, it can also be a Spring bug.

> [@akhilsb97](#):
>
> 1. What is the recommended way to handle an optional collection parameter in JPQL?

Have separate queries, one for an empty list and another for a non-empty list. Or use Criteria queries e.g. through Spring Data Specifications.
