Room SQL: Query object with relation 1-to-Many using WHERE parameters on both tables
问题 I have these classes: @Entity public class Person { long id; String name; } @Entity public class Dog { long id; String color; long idPerson; } public class PersonWithDog { @Embedded Person person; @Relation(parentColumn = "id", entityColumn = "idPerson", entity = Dog.class) List<Dog> dogs; } I want to make a query to return a person and a list of only black dogs he owns. Something like: SELECT * FROM Person LEFT JOIN Dogs ON Person.id = Dogs.idPerson WHERE Person.id = ? AND Dogs.color = black