How to escape question mark (?) character with Spring JpaRepository

You can use direct call to a function jsonb_exists_any().
So in your case it would be

jsonb_exists_any(u.authorities::jsonb, array['ROLE_1', 'ROLE_2'])

Leave a Comment