QBGenericColumnComparable

Overview

Compare functions on generic columns, supports all type-specific comparisons (e.g like on text columns)

Properties Summarized

Type
Name
Summary

Compare column with null.

Create a negated condition.

Methods Summarized

Type
Name
Summary

Compare column to a range of 2 values or other columns.

Compare column with a value or another column.

Compare column with a value or another column.

Compare column with a value or another column.

Compare column with subquery result.

Compare column with values.

Compare column with custom query result.

Compare column with a value or another column.

Compare column with a value or another column.

Compare column with a value or another column.

Compare column with a value or another column.

Properties Detailed

isNull

Compare column with null.

Type QBCondition a QBCondition representing the "is null" comparison.

Sample

query.where.add(query.columns.flag.isNull)

not

Create a negated condition.

Type QBGenericColumnComparable a QBColumn representing the negated condition.

Sample

query.where.add(query.columns.flag.not.eq(1))

Methods Detailed

between(value1, value2)

Compare column to a range of 2 values or other columns.

Parameters

Returns: QBCondition a QBCondition representing the "between" comparison for the two values.

Sample

query.where.add(query.columns.flag.between(0, 5))

eq(value)

Compare column with a value or another column. Operator: equals

Parameters

Returns: QBCondition a QBCondition representing the "equals" comparison.

Sample

query.where.add(query.columns.flag.eq(1))

ge(value)

Compare column with a value or another column. Operator: greaterThanOrEqual

Parameters

Returns: QBCondition a QBCondition representing the "greater than or equal to" comparison.

Sample

query.where.add(query.columns.flag.ge(2))

gt(value)

Compare column with a value or another column. Operator: greaterThan

Parameters

Returns: QBCondition a QBCondition representing the "greater than" comparison.

Sample

query.where.add(query.columns.flag.gt(0))

isin(query)

Compare column with subquery result.

Parameters

Returns: QBCondition a QBCondition representing the "in" comparison with a subquery.

Sample

query.where.add(query.columns.flag.isin(query2))

isin(values)

Compare column with values.

Parameters

  • Array values array of values

Returns: QBCondition a QBCondition representing the "in" comparison with a list of values.

Sample

query.where.add(query.columns.flag.isin([1, 5, 99]))

isin(customQuery, args)

Compare column with custom query result.

Parameters

  • String customQuery custom query

  • Array args query arguments

Returns: QBCondition a QBCondition representing the "in" comparison with a custom query and arguments.

Sample

query.where.add(query.columns.ccy.isin("select ccycode from currencies c where c.category = " + query.getTableAlias() + ".currency_category and c.flag = ?", ['T']))

le(value)

Compare column with a value or another column. Operator: lessThanOrEqual

Parameters

Returns: QBCondition a QBCondition representing the "less than or equal to" comparison.

Sample

query.where.add(query.columns.flag.le(2))

like(pattern)

Compare column with a value or another column. Operator: like

Parameters

  • Object pattern the string value of the pattern

Returns: QBCondition the QBCondition that can be added to a where clause

Sample

query.where.add(query.columns.companyname.like('Serv%'))

// case-insensitive compares can be done using the upper (or lower) functions,
// this can be useful when using for example German letters like ß,
query.where.add(query.columns.companyname.upper.like(query.functions.upper('groß%')))

like(pattern, escape)

Compare column with a value or another column. Operator: like, with escape character

Parameters

  • Object pattern the string value of the pattern

  • Number escape the escape char

Returns: QBCondition the QBCondition that can be added to a where clause

Sample

query.where.add(query.columns.companyname.like('X_%', '_')

lt(value)

Compare column with a value or another column. Operator: lessThan

Parameters

Returns: QBCondition a QBCondition representing the "less than" comparison.

Sample

query.where.add(query.columns.flag.lt(99))

Last updated

Was this helpful?