# Boolean/String conversion issues after Hibernate 5-\>6 migration

**URL:** <https://discourse.hibernate.org/t/boolean-string-conversion-issues-after-hibernate-5-6-migration/8408>\
**Category:** Hibernate ORM\
**Created:** [October 17, 2023, 3:30pm UTC](https://discourse.hibernate.org/t/boolean-string-conversion-issues-after-hibernate-5-6-migration/8408 "2023-10-17T15:30:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![badamczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/badamczyk/32/2711_2.png) [@badamczyk](https://discourse.hibernate.org/u/badamczyk)\
**Post date:** [October 17, 2023, 3:30pm UTC](https://discourse.hibernate.org/t/boolean-string-conversion-issues-after-hibernate-5-6-migration/8408/1 "2023-10-17T15:30:28Z")

</div>

During the process of migration from SpringBoot 2.x.x to 3.x.x (and effectively Hibernate) I got stuck on a problem with entity column value converters.

I got the entity with Boolean type field, which is stored in the DB as either **Y** , **N** or **null** (varchar2 (1 char)):

```auto
    @Entity
    @Table(name = "ENTITY_WITH_CONVERTED_FIELD")
    public class EntityWithConvertedField {
    
    @Id
    @Column(name = “ID”)
    private Long id;
    
    @Column(name = “MY_FLAG)
    @Convert(converter = YesNoConverter.class) // OOTB converter from org.hibernate.type package
    private Boolean myFlag; // this value is stored as either ‘Y’, ‘N’ or null in the db
    }

```

When this entity is then used in the queries (ex. CriteriaQuery, queries in the annotations of repository methods) I keep getting exceptions that looks like more or less like this:

```auto
    org.springframework.dao.InvalidDataAccessResourceUsageException: JDBC exception executing SQL [select mt1_0.ID from EntityWithConvertedField mt1_0 where mt1_0.MY_FLAG = false and mt1_0.ID=?] [ORA-00904: "FALSE": invalid identifier] [n/a]; SQL [n/a]

```

It would suggest that no conversion happens on the Hibernate side.

On Hibernate versions prior to the 6.x, everything worked like a charm.  
I’m running on SpringBoot 3.1.4 (with Hibernate 6.2.9.Final). I’ve tried bumping the Hibernate version to the latest one but with no luck.

Thanks in advance!

---

<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:** [October 18, 2023, 1:35pm UTC](https://discourse.hibernate.org/t/boolean-string-conversion-issues-after-hibernate-5-6-migration/8408/2 "2023-10-18T13:35:26Z")

</div>

That might be a bug, but this would be surprising. Could you try creating reproducer 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)) for this and attach it to a new bug ticket on Jira ([https://hibernate.atlassian.net](https://hibernate.atlassian.net)) please?
