Skip to main content

Or Not

Definition

The orNot methods allows you to add the OR NOT operator to a WHERE clause.

Available methods

1. orNot(KCondition kCondition)

  • kCondition: which contains all the information about the condition that will be added to the WHERE clause with an OR NOT operator.

2. orNot(KRaw kRaw)

  • kRaw: is a raw content which will be added in the WHERE clause with an OR NOT operator.

Method hierarchy

The orNot method can be used right after the following methods:

and the subsequent methods that can be called are:

Example: KCondition

Java code:

k
.deleteFrom(APP_USER)
.where(APP_USER.ID.gt(559))
.orNot(APP_USER.ACTIVE.isTrue())
.execute();

SQL generated:

DELETE
FROM app_user au
WHERE au.id > ?
OR NOT (au.active IS TRUE)

Parameters:

  • ?1: 559

Example: KRaw

Java code:

k
.deleteFrom(APP_USER)
.where(raw("au.id > 559"))
.orNot(raw("au.active IS TRUE"))
.execute();

SQL generated:

DELETE
FROM app_user au
WHERE au.id > 559
OR NOT (au.active IS TRUE)

Parameters:

  • None