Trying to solve Postgresql Array Functions with QueryDSL more cleanly, I've got this far.
// obj.foo is an ArrayPath<String[], String>
bindings.bind(obj.foo).first((path, value) ->
Expressions.booleanTemplate("arraycontains({0}, {1}) = true", path, value));
this ends up as correct-looking SQL
where arraycontains(obj0_1_.foo, ?)=true
but it seems the String[]
variable is not passed correctly
org.postgresql.util.PSQLException: ERROR: function arraycontains(character varying[], bytea) does not exist
How can I either (if possible)
- get the
String[]
value to bind as avarchar[]
? - express the necessary cast in the
booleanTemplate
?