ILike Start With methods
Definition
The iLike Start 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 end.
The methods available in Normal method name and the Short method name versions are:
Normal method name | Short method name | SQL to generate |
---|---|---|
iLikeStartWith | ilksw | leftOp ILIKE CONCAT(rightOp, '%') |
notILikeStartWith | nilksw | 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. iLikeStartWith | ilksw
leftOperand LIKE CONCAT(rightOperand, '%')
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: ilksw(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilksw(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: ilksw(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilksw("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE ?1
Parameters:
- ?1: "Jhon%"
Example: ilksw(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilksw(optional(nullValue)))
.and(APP_USER.FIRST_NAME.ilksw(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name ILIKE ?1
Parameters:
- ?1: "Jhon%"
2. notILikeStartWith | nilksw
NOT (leftOperand LIKE CONCAT(rightOperand, '%'))
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: nilksw(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilksw(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: nilksw(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilksw("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE ?1)
Parameters:
- ?1: "Jhon%"
Example: nilksw(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilksw(optional(nullValue)))
.and(APP_USER.FIRST_NAME.nilksw(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name ILIKE ?1)
Parameters:
- ?1: "Jhon%"