Skip to content

Native query with a null value parameter results to java.lang.UnsupportedOperationException #2145

@s4iko

Description

@s4iko

Hi,

I got a native query that doesn't work anymore until the upgrade to Quarkus 3.18.4 (= Hibernate Reactive 2.4.5 (hibernate core 6.6.7)). The version was 3.16.6 before the upgrade.
It seems that a null value cannot be handled properly in org.hibernate.type.descriptor.jdbc.new BasicBinder() {...}.doBindNull(PreparedStatement, int, WrapperOptions) due to st.getParameterMetaData() returning null.

I did a try passing the parameter using setParameter(Parameter<?> param, ...) but still no luck:

Parameter<?> param = new NamedParameterDescriptor<String>("value", StandardBasicTypes.STRING, new int[]{0});
query.setParameter(param, null);

My query is using Postgres specific notation to query JSON fields (that's why I use a native query):

select *
from myTabel
where myColumn ->> 'myJsonKey' = :value

Is there a new expected behavior or an issue ?
Is there a workaround or an other way to do this ?

Thanks, br

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions