When upgrading to Spring Boot 4 (Hibernate 7) you can get the message that the json functions are incubated, i.e. default its turned off. It will then tell you to set hibernate.query.hql.json_functions_enabled to true. This is setup in the application.properties.
But when using spring, you will have to prefix it with spring.jpa.properties for this to work:
spring.jpa.properties.hibernate.query.hql.json_functions_enabled=true
spring.jpa.properties.hibernate.query.hql.xml_functions_enabled=true
Now for the question: Why is this functionality default turned off? Isn't it reliable enough in Hibernate 7 or not properly tested yet?
From javadocs:
public @interface Incubating
Marks the annotated Java element as incubating, potentially recursively. An incubating API is one which is still being actively developed and therefore may change at a later time; a "tech preview". The user of such an API is considered an early adopter who helps shape the final definition of the API.
JSON function were released in 7.0.0 on May 19, the discussion and JIRA tickets don't add much information on why it is incubating still.
But its safe to assume it is incubating because it's very new functionality and not battle tested enough, so user feedback is needed for now.
In short, it means unstable API for now, method signatures may break on future releases, so it's safer to tell devs you must opt-in and recognize you might need to change some code when upgrading later, this way users that just want full stability are not affected.