ILike End With methods
Definition
The iLike End With methods allow you to add the ILIKE operator to the query. Additionally, the object or value that is received by parameter will be concatenated with the % character at the beginning.
The methods available in Normal method name and the Short method name versions are:
Normal method name | Short method name | SQL to generate |
---|---|---|
iLikeEndWith | ilkew | leftOp ILIKE CONCAT('%', rightOp) |
notILikeEndWith | nilkew | NOT (leftOp ILIKE CONCAT('%', rightOp)) |
For all cases, the object that calls Like Any 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. iLikeEndWith | ilkew
leftOperand ILIKE CONCAT('%', rightOperand)
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: ilkew(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilkew(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE CONCAT('%', au.last_name)
Parameters:
- None
Example: ilkew(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilkew("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE ?1
Parameters:
- ?1: "%Jhon"
Example: ilkew(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilkew(optional(nullValue)))
.and(APP_USER.FIRST_NAME.ilkew(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE ?1
Parameters:
- ?1: "%Jhon"
2. notILikeEndWith | nilkew
NOT (leftOperand ILIKE CONCAT('%', rightOperand))
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: nilkew(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilkew(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE CONCAT('%', au.last_name))
Parameters:
- None
Example: nilkew(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilkew("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE ?1)
Parameters:
- ?1: "%Jhon"
Example: nilkew(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilkew(optional(nullValue)))
.and(APP_USER.FIRST_NAME.nilkew(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE ?1)
Parameters:
- ?1: "%Jhon"