Yoavya
10/08/2020, 4:45 PMobject UserQuestionTable : LongIdTable("user_question") {
val uid = reference("uid", UserTable, onDelete = ReferenceOption.CASCADE)
val oid = optReference("oid", OtherTable)
val allow = bool("allow").default(true)
}
but you have a complex join that is not just the reference ids equal
UserQuestionTable.join(OtherTable, JoinType.LEFT, additionalConstraint = {
(OtherTable.id inList otherIds) and (
(OtherTable.id eq UserQuestionTable.oid) or (
UserQuestionTable.oid.isNull() and (UserQuestionTable.allow eq true)
)
)
})
but the output query is added a user_question.oid = other.id
and then the rest of the additional constraint query
what can I do to remove this addition?tapac
10/13/2020, 8:41 AMUserQuestionTable.join(OtherTable, JoinType.LEFT, onColumn = null, otherColumn = null, additionalConstraint = { /* your condition */ })
Yoavya
10/13/2020, 8:56 AMuser_question.oid = other.id AND (my condition)
as a hack solution I removed the reference in the exposed table (code only). using just a long type for nowtapac
10/13/2020, 9:03 AMYoavya
10/13/2020, 9:03 AM