Module org.jooq
Package org.jooq.impl

Interface QOM.Contains<T>

All Superinterfaces:
Condition, Field<Boolean>, FieldOrConstraint, FieldOrRow, FieldOrRowOrSelect, GroupField, Named, OrderField<Boolean>, QOM.CompareCondition<T,QOM.Contains<T>>, QueryPart, SelectField<Boolean>, SelectFieldOrAsterisk, Serializable, TableElement, Typed<Boolean>
Enclosing class:
QOM

public static interface QOM.Contains<T> extends QOM.CompareCondition<T,QOM.Contains<T>>
The CONTAINS operator.

Convenience method for Field.like(String, char) including proper adding of wildcards and escaping.

SQL: this like ('%' || escape(value, '\') || '%') escape '\'

Note: This also works with numbers, for instance val(1133).contains(13)

If you're using SQLDialect.POSTGRES, then you can use this method also to express the "ARRAY contains" operator. For example:


 // Use this expression
 val(new Integer[] { 1, 2, 3 }).contains(new Integer[] { 1, 2 })

 // ... to render this SQL
 ARRAY[1, 2, 3] @> ARRAY[1, 2]
 

Note, this does not correspond to the Oracle Text CONTAINS() function. Refer to OracleDSL.contains(Field, String) instead.