diff --git a/exposed/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt b/exposed/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt index fef993a46b..eb225de036 100644 --- a/exposed/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt +++ b/exposed/src/main/kotlin/org/jetbrains/exposed/sql/SQLExpressionBuilder.kt @@ -86,7 +86,14 @@ object SqlExpressionBuilder { return NeqOp(this, wrap(other)) } - infix fun ExpressionWithColumnType.neq(other: Expression) : Op = NeqOp(this, other) + infix fun > Column>.neq(t: T?) : Op { + if (t == null) { + return isNotNull() + } + return NeqOp(this, wrap(t)) + } + + infix fun Expression.neq(other: Expression) : Op = NeqOp(this, other) fun ExpressionWithColumnType.isNull(): Op = IsNullOp(this)