Postgres defines additional jsonb Operators such as ?|.
However, using Spring JpaRepository query builder, interrogation character is always considered
As a workaround for that specific case, I created a custom operator:
CREATE OPERATOR ~~~| (
LEFTARG = jsonb,
RIGHTARG = _text,
PROCEDURE = pg_catalog.jsonb_exists_any
)
Then in my query: WHERE u.authorities ~~~| array['ROLE_1', 'ROLE_2']
@ŁukaszKamiński detailed this workaround in his answer here: https://stackoverflow.com/a/50488457/1097926