Greater Than Or Equal To methods
Definition
The Greater 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 |
---|---|---|
greaterThanOrEqualTo | gte | leftOp >= rightOp |
iGreaterThanOrEqualTo | igte | LOWER(leftOp) >= LOWER(rightOp) |
notGreaterThanOrEqualTo | ngte | NOT (leftOp >= rightOp) |
notIGreaterThanOrEqualTo | nigte | NOT (LOWER(leftOp) >= LOWER(rightOp)) |
For all cases, the object that calls Greater 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. greaterThanOrEqualTo | gte
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: gte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.gte(APP_USER.LAST_NAME))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name >= au.last_name
Parameters:
- None
Example: gte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.gte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name >= ?1
Parameters:
- ?1: "Jhon"
Example: gte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.gte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.gte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE au.first_name >= ?1
Parameters:
- ?1: "Jhon"
Example: gte(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.gte(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. iGreaterThanOrEqualTo | igte
LOWER(leftOperand) >= LOWER(rightOperand)
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: igte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.igte(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: igte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.igte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE LOWER(au.first_name) >= ?1
Parameters:
- ?1: "jhon"
Example: igte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.igte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.igte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE LOWER(au.first_name) >= ?1
Parameters:
- ?1: "jhon"
3. notGreaterThanOrEqualTo | ngte
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: ngte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ngte(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: ngte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ngte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name >= ?1)
Parameters:
- ?1: "Jhon"
Example: ngte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.ngte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.ngte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (au.first_name >= ?1)
Parameters:
- ?1: "Jhon"
Example: ngte(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.ngte(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. notIGreaterThanOrEqualTo | nigte
NOT (LOWER(leftOperand) >= LOWER(rightOperand))
This method takes a single parameter and the possible values are:
KTableColumn
, KColumn
, String
, KValTextField
, KOptionalKColumn
, KOptionalString
, KOptionalKValTextField
.
Example: nigte(KColumn)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nigte(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: nigte(String)
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nigte("Jhon"))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (LOWER(au.first_name) >= ?1)
Parameters:
- ?1: "jhon"
Example: nigte(KOptionalString)
Java code:
final String nullValue = null;
k
.select(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.FIRST_NAME.nigte(optional(nullValue)))
.and(APP_USER.FIRST_NAME.nigte(optional("Jhon")))
.multiple();
SQL generated:
SELECT au.id
FROM app_user au
WHERE NOT (LOWER(au.first_name) >= ?1)
Parameters:
- ?1: "jhon"