I have a jsonb column in my posgtgres table the json is of structure : {'alias':["name1","name2","name"....]}
I have written the Postgres query to check if the array in the JSON object contains the name.
select * from public.table t where json_col->'alias' ? 'name'
this works on pgAdmin
But same doesn't work in JPA
My code
@Query(value = "select * from public.table t where json_col->'alias' ? :name" ,nativeQuery = true)
Table findUsingName(@Param("name") String name);
This throws an error : 'Mixing of ? parameters and other forms like ?1 is not supported!'
I understand this error is due to the fact ? is also used by JPA is different sense...
Can anyone help me in the JPA Query
??instead. I think the JDBC driver will detect that's an "escaped"?operator.