how to pass entity member in room query like this?...
# room
c
how to pass entity member in room query like this?
Copy code
@Transaction
    @Query("SELECT * FROM peer where id = :${peer.id}")
    fun getMessage(peer: Peer): List<PeerMessages>
s
breaking your calls into a pair of functions can help here for example:
Copy code
@Transaction
    @Query("SELECT * FROM peer where id = :peerId")
    fun getMessage(peerId: String): List<PeerMessages>
Copy code
fun getMessage(peer: Peer): List<PeerMessages> = getMessage(peer.id)
c
no way to use a data class inside a query?
s
Not that I'm aware of. I don't think Room supports codegen inside queries