I need to fire a select query against Postgres jsonb column:
entityManager.createNativeQuery(
"select * from table where jsonbcol -> 'usernames' ? :un"
).setParameter("un", userName).getResultList()
Upon running the Exception is thrown:
org.hibernate.engine.query.ParameterRecognitionException: Mixed parameter strategies -
use just one of named, positional or JPA-ordinal strategy
I tried escaping like \\? and ?? but that didn't help.
How to do that call properly?