@Relation Room DB with multiple columns
Asked Answered
S

0

8

If i want to related 2 tables and the relation is not only one column but more, is there a way to use the Room @Relation annotation with more arguments to achive that? Perhaps somehting like below

@Relation(parentColumn = "{message_id,account_id}", entityColumn = "{message_id, from_account_id}", entity = Message::class)
    var messageList: List<Message> = ArrayList()

So that the join has more than one constraint?

Stempson answered 17/4, 2020 at 21:7 Comment(3)
Did you find an answer to this issue? I am currently facing the same problem.Gagliardi
No, its not that i didn' t find an answer. Its that it can't be done with Room. You have to write it in your query. If you want any help post it and send the link!Stempson
Thank you for your feedback. I have generated this question. If you can help me with the query there would be great. #65771853Gagliardi

© 2022 - 2024 — McMap. All rights reserved.