From aeeb8979cc392b052fda77fc8f8e21671ac467fe Mon Sep 17 00:00:00 2001 From: Tapac Date: Sun, 30 Jun 2019 16:16:58 +0300 Subject: [PATCH] #590 SQL Comparisons lost in upgrade from 0.8 to 0.15 neq function on a column introduced and on ExpressionWithColumnType.neq replaced with Expression.neq --- .../org/jetbrains/exposed/sql/SQLExpressionBuilder.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)