Skip to main content

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 nameShort method nameSQL to generate
lessThanOrEqualTolteleftOp <= rightOp
iLessThanOrEqualToilteLOWER(leftOp) <= LOWER(rightOp)
notLessThanOrEqualTonlteNOT (leftOp <= rightOp)
notILessThanOrEqualTonilteNOT (LOWER(leftOp) <= LOWER(rightOp))
info

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

SQL to generate
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

SQL to generate
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

SQL to generate
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

SQL to generate
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"