I have a tableA with two references, how can I que...
# exposed
r
I have a tableA with two references, how can I query this table like:
TableA.selectAll().where(TableA.ref1 = object1 and TableA.ref2= object2)
Currently i do
Copy code
ref1.tableA.filter { ref2 != object2 }
But I guess I could also do this with exposed
t
TableA.select { TableA.ref1 eq object1 and (TableA.ref2 eq object2) }
https://github.com/JetBrains/Exposed/wiki/DSL#read
r
I'm trying but somehow I cant use
eq
, and I dont know why.
t
what is the
game
? If it's Entity then you have to write
eq game.id
r
Copy code
object GameAnswers : IntIdTable() {
    val game = reference("game", Games)
    val user = reference("user", Users)
Thats the table
Aha
Interesting, didn't know! Yes with id it works
Thanks