Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Comparisons lost in upgrade from 0.8 to 0.15 #590

Closed
ChasDouglass opened this issue Jun 27, 2019 · 1 comment
Closed

SQL Comparisons lost in upgrade from 0.8 to 0.15 #590

ChasDouglass opened this issue Jun 27, 2019 · 1 comment

Comments

@ChasDouglass
Copy link

Upgrading from 0.8 to 0.15 the following statement threw an error:

Island.find{Islands.id neq 0}.forEach { island ->

IslandInfo.kt: (58, 40): None of the following functions can be called with the arguments supplied:
public final infix fun ExpressionWithColumnType.neq(other: ???): Op defined in org.jetbrains.exposed.sql.SqlExpressionBuilder public final infix fun ?, S2 : EntityID?> ExpressionWithColumnType<in EntityID>.neq(other: Expression<in EntityID>): Op defined in org.jetbrains.exposed.sql.SqlExpressionBuilder

Since "eq" still worked but "neq" didn't, I looked at the source code. I copied one of the "eq" extensions like this:
infix fun <T:Comparable<T>> Column<EntityID<T>>.neq(t: T?) : Op<Boolean> { if (t == null) { return isNull() } return NeqOp(this, wrap(t)) }
into my code and that seems to make it work.
I notice that "greater" has the same problem as "neq".

Is there a "new" way of doing this, or were these dropped for a reason?

Tapac added a commit that referenced this issue Jun 30, 2019
neq function on a column introduced and on ExpressionWithColumnType.neq replaced with Expression.neq
@Tapac
Copy link
Contributor

Tapac commented Jun 30, 2019

Fixed in master for neq

@Tapac Tapac closed this as completed Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants