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?

james04
  • 1,580
  • 2
  • 20
  • 46
  • Did you find an answer to this issue? I am currently facing the same problem. – Felix H Jan 18 '21 at 08:06
  • 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! – james04 Jan 18 '21 at 14:02
  • Thank you for your feedback. I have generated this question. If you can help me with the query there would be great. https://stackoverflow.com/questions/65771353/android-room-apply-multiple-columns-in-relation-of-embedded-object – Felix H Jan 18 '21 at 14:16

0 Answers0