martmists
01/19/2022, 12:23 PMobject CommentTable : LongIdTable() {
val post = reference("post", PostTable)
val parent = optReference("parent", CommentTable)
val author = reference("author", UserTable)
val content = text("content")
val created = datetime("created")
val updated = datetime("updated")
}
but when doing CommentTable.parent eq null
I get
Overload resolution ambiguity:
public open fun <T : Comparable<TypeVariable(T)>, E : EntityID<TypeVariable(T)>?> ExpressionWithColumnType<TypeVariable(E)>.eq(t: TypeVariable(T)?): Op<Boolean> defined in org.jetbrains.exposed.sql.SqlExpressionBuilder
public open fun <T> ExpressionWithColumnType<TypeVariable(T)>.eq(t: TypeVariable(T)): Op<Boolean> defined in org.jetbrains.exposed.sql.SqlExpressionBuilder
dave08
01/19/2022, 2:11 PM.nullable()
to the column definitionreference
then use optReference
martmists
01/19/2022, 2:28 PMdave08
01/19/2022, 2:29 PMobject NodeTable : IntIdTable() {
val name = varchar("name", 50)
}
object NodeToNodes : Table() {
val parent = reference("parent_node_id", NodeTable)
val child = reference("child_user_id", NodeTable)
}
I wonder if the fact you're referencing the table itself causes the problem?EntityID
not an Int
by the way. So maybe there's some kind of empty instance of it to denote null instead of null
?martmists
01/19/2022, 2:49 PMdave08
01/19/2022, 2:50 PMmartmists
01/19/2022, 3:21 PM