Configuration setting for jpamodelgen annotation processor

I’ve been using Hibernate’s Jakarta Data implementation for a while, including some JSON functions in queries embedded in Jakarta Data annotations.

After upgrading from Hibernate versjon 7.0.0-Beta1 to CR1 I get the following error message in maven’s compile task:

Can't use function 'json_query', because tech preview JSON functions are not enabled. To enable, set the 'hibernate.query.hql.json_functions_enabled' setting to 'true'

Now I wonder how to set this setting so it is seen by the jpamodelgen annotation processor. I’ve tried adding it as a compiler arg with

<compilerArgs>
    <arg>-Ahibernate.query.hql.json_functions_enabled=true</arg>
</compilerArgs>

This didn’t seem to have any effect, neither did adding it to persistence.xml (which I assume is for runtime settings).

So, the question is, how to set hibernate.query.hql.json_functions_enabled so it is seen by the annotation processor?

Hallvard

There is no way to do that unfortunately, because the SqmCreationOptions that the annotation processor uses is a custom variant that is not based on configuration.

Please create a bug ticket in our issue tracker for this. You can even work on this yourself if you want to get your feet wet :wink: