# Problem with Query using JSON\_SET after change v5.4.x to v.6.5.4

**URL:** <https://discourse.hibernate.org/t/problem-with-query-using-json-set-after-change-v5-4-x-to-v-6-5-4/10785>\
**Category:** Hibernate ORM\
**Created:** [December 12, 2024, 3:01pm UTC](https://discourse.hibernate.org/t/problem-with-query-using-json-set-after-change-v5-4-x-to-v-6-5-4/10785 "2024-12-12T15:01:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leandro](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/leandro/32/3690_2.png) [@Leandro](https://discourse.hibernate.org/u/Leandro)\
**Post date:** [December 12, 2024, 3:01pm UTC](https://discourse.hibernate.org/t/problem-with-query-using-json-set-after-change-v5-4-x-to-v-6-5-4/10785/1 "2024-12-12T15:01:21Z")

</div>

Code example:

```auto
    @Query(value = "update Entity set json = JSON_SET(json,'$.field', 0) where id = :id")
    void example(@Param("id") String id);

```

```auto
a.lang.IllegalArgumentException: org.hibernate.query.SemanticException: Cannot assign expression of type 'java.lang.Object' to target path 'alias_1039732747.json' of type 'java.lang.String'

```

After migrating spring boot 3.3.4 the hibernate core changed to 6.5.4, I am having problems using a mysql function in the Query annotation.

Is there any way to solve this?

---

<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:** [December 13, 2024, 9:34am UTC](https://discourse.hibernate.org/t/problem-with-query-using-json-set-after-change-v5-4-x-to-v-6-5-4/10785/2 "2024-12-13T09:34:27Z")

</div>

You can use a cast e.g. `json = cast(json_set(json,'$.field',0) as string)`
