ILike methods
Definition
The iLike methods allow you to add the ILIKE operator to the query.
The methods available in Normal method name and the Short method name versions are:
Normal method name | Short method name | SQL to generate |
---|---|---|
iLike | ilk | leftOp ILIKE rightOp |
notILike | nilk | NOT (leftOp ILIKE rightOp) |
For all cases, the object that calls Like methods will be placed as the operand on the left side of the ILIKE operator and the object or value received by parameter will be placed on the right side of the ILIKE operator.
1. iLike | ilk
leftOperand ILIKE rightOperand
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: ilk(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilk(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE au.last_name
Parameters:
- None
Example: ilk(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilk("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE ?1
Parameters:
- ?1: "Jhon"
Example: ilk(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilk(optional(nullValue)))
.and(APP_USER.FIRST_NAME.ilk(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE ?1
Parameters:
- ?1: "Jhon"
2. notILike | nilk
NOT (leftOperand ILIKE rightOperand)
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: nilk(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilk(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE au.last_name)
Parameters:
- None
Example: nilk(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilk("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE ?1)
Parameters:
- ?1: "Jhon"
Example: nilk(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilk(optional(nullValue)))
.and(APP_USER.FIRST_NAME.nilk(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE ?1)
Parameters:
- ?1: "Jhon"