Problem with Query using JSON_SET after change v5.4.x to v.6.5.4

Code example:

    @Query(value = "update Entity set json = JSON_SET(json,'$.field', 0) where id = :id")
    void example(@Param("id") String id);
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?

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