# Hibernate 6: Boolean Parameter in @Query Not Bound

**URL:** <https://discourse.hibernate.org/t/hibernate-6-boolean-parameter-in-query-not-bound/8245>\
**Category:** Hibernate ORM\
**Created:** [September 13, 2023, 11:49pm UTC](https://discourse.hibernate.org/t/hibernate-6-boolean-parameter-in-query-not-bound/8245 "2023-09-13T23:49:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gburgalum01](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@gburgalum01](https://discourse.hibernate.org/u/gburgalum01)\
**Post date:** [September 13, 2023, 11:49pm UTC](https://discourse.hibernate.org/t/hibernate-6-boolean-parameter-in-query-not-bound/8245/1 "2023-09-13T23:49:57Z")

</div>

I’m in the process of upgrading an application from Spring Boot 2.7 and Hibernate 5 to Spring Boot 3.1.2 and Hibernate 6.2.6 and am running into an issue with a query that did not previously present any issue. Note that I’m running an SQL Server 2017 database to which data is to be persisted.

In my repository class, I have the following query.

```auto
@Modifying
@Transactional
@Query("UPDATE Employee AS e SET e.medicalActive = ?2, e.dentalActive = ?2 WHERE e.employeeId.nationalId IN ?1)
void updateEmployeeHealthStatus(List<String> nationalIds, boolean healthInsuranceActive);

```

The entity class is pretty standard. I have the two boolean fields that I’m trying to update declared as below.

```auto
@Column(name = "[MEDICAL_ACTIVE]")
@JsonProperty("MEDICAL_ACTIVE")
@Convert(converter = YesNoConverter.class)
private boolean medicalActive;

@Column(name = "[DENTAL_ACTIVE]")
@JsonProperty("DENTAL_ACTIVE")
@Convert(converter = YesNoConverter.class)
private boolean dentalActive;

```

When I execute the query, I’m observing the following error.

```auto
org.hibernate.sql.exec.ExecutionException: A problem occurred in the SQL executor : JDBC parameter value not bound - org.hibernate.sql.exec.internal.SqlTypedMappingJdbcParameter@6e03373d

```

If I remove the converter annotation from both fields, the query runs fine. Unfortunately, instead of storing Y or N in the database fields - both of which are set to VARCHAR(1) type - it stores 1 or 0. I’d prefer to store the Y or N values instead.

What am I doing wrong?

---

<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 18, 2023, 11:19am UTC](https://discourse.hibernate.org/t/hibernate-6-boolean-parameter-in-query-not-bound/8245/2 "2023-09-18T11:19:54Z")

</div>

This could be a bug, so please create an issue in the issue tracker([https://hibernate.atlassian.net](https://hibernate.atlassian.net)) with a test case([https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java](https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java)) that reproduces the issue.
