# Mapping Jsonb (postgres) in 6.2.3.Final

**URL:** <https://discourse.hibernate.org/t/mapping-jsonb-postgres-in-6-2-3-final/8431>\
**Category:** Hibernate ORM\
**Created:** [October 23, 2023, 4:15am UTC](https://discourse.hibernate.org/t/mapping-jsonb-postgres-in-6-2-3-final/8431 "2023-10-23T04:15:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor\_Gatsev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/igor_gatsev/32/2727_2.png) [@Igor\_Gatsev](https://discourse.hibernate.org/u/Igor_Gatsev)\
**Post date:** [October 23, 2023, 4:15am UTC](https://discourse.hibernate.org/t/mapping-jsonb-postgres-in-6-2-3-final/8431/1 "2023-10-23T04:15:32Z")

</div>

Mapping field like:  
@JdbcTypeCode(SqlTypes.JSON)  
private Map\<String, Object\> category;

In latest 6.2.3.Final mapping jsonb postgres is wrong, this error  
class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map

Latest working in 6.1.7.Final

---

<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 23, 2023, 8:54am UTC](https://discourse.hibernate.org/t/mapping-jsonb-postgres-in-6-2-3-final/8431/2 "2023-10-23T08:54:33Z")

</div>

How about you give 6.2.13.Final a try?

---

<div class="post-metadata">

**Author:** ![Igor\_Gatsev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/igor_gatsev/32/2727_2.png) [@Igor\_Gatsev](https://discourse.hibernate.org/u/Igor_Gatsev)\
**Post date:** [October 24, 2023, 3:55am UTC](https://discourse.hibernate.org/t/mapping-jsonb-postgres-in-6-2-3-final/8431/3 "2023-10-24T03:55:44Z")

</div>

Same error  
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader ‘bootstrap’)

I read that there were changes in working with JSON and Oracle, maybe there was a problem there

---

<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 24, 2023, 7:45am UTC](https://discourse.hibernate.org/t/mapping-jsonb-postgres-in-6-2-3-final/8431/4 "2023-10-24T07:45:40Z")

</div>

Please try to create a reproducer with our test case template ([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)) and if you are able to reproduce the issue, create a bug ticket in our issue tracker([https://hibernate.atlassian.net](https://hibernate.atlassian.net)) and attach that reproducer.
