|The jOOQ User Manual : SQL building : SQL building in Kotlin : Kotlin BOOLEAN value expressions||previous : next|
Kotlin BOOLEAN value expressions
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
In jOOQ, the two things can often be used exchangeably, but there are some exceptions, mainly when BOOLEAN operators should be used with (
At least the left side of the expression has to be wrapped with DSL.condition(Field), which is cumbersome.
Using the kotlin extensions module, these operators are also made available on
package org.jooq.kotlin fun Field<Boolean>.and(other: Condition): Condition = condition(this).and(other) fun Field<Boolean>.or(other: Condition): Condition = condition(this).or(other) fun Field<Boolean>.not(): Condition = condition(this).not() // [... and more]
This allows for the leaner version below: