I am using spring boot and jpa to execute native queries. One of my column is jsonb and I need to use json operator "?|" which tries to see if any value exist in array. It fails with "ordinal parameter not bound: 1"
This is what I am trying to execute:
query = "select id from test where array['partner'] @> facet_names and ( values->'partner' is null or (values->'partner'->>'operator'='IN' and values->'partner'->'values' ?| array['partner.com']) ) order by rank limit 1;"
this.entityManager.createNativeQuery(query).getResultList()
I got this error:
Ordinal parameter not bound : 1
And I know it is because of operator "?" but how do I resolve this?
I tried escaping operator "?" using \ and then I got a different error
org.postgresql.util.PSQLException: No value specified for parameter 1.