Less Than Or Equal To methods
Definition
The Less Than Or Equal To methods allow you to add the <= 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 |
---|---|---|
lessThanOrEqualTo | lte | leftOp <= rightOp |
iLessThanOrEqualTo | ilte | LOWER(leftOp) <= LOWER(rightOp) |
notLessThanOrEqualTo | nlte | NOT (leftOp <= rightOp) |
notILessThanOrEqualTo | nilte | NOT (LOWER(leftOp) <= LOWER(rightOp)) |
For all cases, the object that calls Less Than Or Equal To methods will be placed as the operand on the left side of the <= operator and the object or value received by parameter will be placed on the right side of the <= operator.
1. lessThanOrEqualTo | lte
leftOperand <= rightOperand
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, Number
, String
, LocalDate
, LocalDateTime
, KValNumberField
, KValTextField
, KQuery
, KOptionalKColumn
, KOptionalNumber
, KOptionalString
, KOptionalLocalDate
, KOptionalLocalDateTime
, KOptionalKValNumberField
, KOptionalKValTextField
, KOptionalLong
.
If the object received by parameter is a KQuery
, it will be treated as a subquery and you must ensure that it returns only one column comparable to the operand on the left side of the condition.
Example: lte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.lte(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name <= au.last_name
Parameters:
- None
Example: lte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.lte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name <= ?1
Parameters:
- ?1: "Jhon"
Example: lte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.lte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.lte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name <= ?1
Parameters:
- ?1: "Jhon"
Example: lte(KQuery)
Java code:
final KQuery subquery =
k
.select(max(APP_USER_SPECIALTY.APP_USER_ID))
.from(APP_USER_SPECIALTY);
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.ID.lte(subquery))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.id <= (
SELECT MAX(aus.app_user_id)
FROM app_user_specialty aus
)
Parameters:
- None
2. iLessThanOrEqualTo | ilte
LOWER(leftOperand) <= LOWER(rightOperand)
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: ilte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilte(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE LOWER(au.first_name) <= LOWER(au.last_name)
Parameters:
- None
Example: ilte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE LOWER(au.first_name) <= ?1
Parameters:
- ?1: "jhon"
Example: ilte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ilte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.ilte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE LOWER(au.first_name) <= ?1
Parameters:
- ?1: "jhon"
3. notLessThanOrEqualTo | nlte
NOT (leftOperand <= rightOperand)
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, Number
, String
, LocalDate
, LocalDateTime
, KValNumberField
, KValTextField
, KQuery
, KOptionalKColumn
, KOptionalNumber
, KOptionalString
, KOptionalLocalDate
, KOptionalLocalDateTime
, KOptionalKValNumberField
, KOptionalKValTextField
, KOptionalLong
.
If the object received by parameter is a KQuery
, it will be treated as a subquery and you must ensure that it returns only one column comparable to the operand on the left side of the condition.
Example: nlte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nlte(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name <= au.last_name)
Parameters:
- None
Example: nlte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nlte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name <= ?1)
Parameters:
- ?1: "Jhon"
Example: nlte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nlte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.nlte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name <= ?1)
Parameters:
- ?1: "Jhon"
Example: nlte(KQuery)
Java code:
final KQuery subquery =
k
.select(max(APP_USER_SPECIALTY.APP_USER_ID))
.from(APP_USER_SPECIALTY);
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.ID.nlte(subquery))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (
au.id <= (
SELECT MAX(aus.app_user_id)
FROM app_user_specialty aus
)
)
Parameters:
- None
4. notILessThanOrEqualTo | nilte
NOT (LOWER(leftOperand) <= LOWER(rightOperand))
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: nilte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilte(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (LOWER(au.first_name) <= LOWER(au.last_name))
Parameters:
- None
Example: nilte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (LOWER(au.first_name) <= ?1)
Parameters:
- ?1: "jhon"
Example: nilte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nilte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.nilte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (LOWER(au.first_name) <= ?1)
Parameters:
- ?1: "jhon"