Replies: 1 comment
-
nested lists are currently impossible as stream objects. But simply streaming the output of a join is possible, if you create a database view for it: @DatabaseView('SELECT table_a.id AS aid, table_b.id AS bid, table_b.name FROM table_a, table_b WHERE table_a.id==table_b.aid')
class MyJoinedObject{
int aid;
int bid;
String name;
MyJoinedObject(this.aid, this.bid, this.name);
} and in the DAO: @Query('SELECT * FROM MyJoinedObject')
Stream<List<MyJoinedObject>> getStreamedStuff(); Don't forget to add the view object to the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
I have a quick questions.
I have objects that relate to each other. The best options would be to create an single join to create this Object but maybe you know a better way to do this with your library.
The structure looks like this: journey -> phases (list) -> learn_units (list)
I would like to have it in an object like this.
class JourneyWithPhases { Journey journey; List<Phase> phases; }
Is there any way to do this with your library without loosing the compatibility of stream objects. Like updating the learn units and it gets populated to update the journey and so on.
Would be nice if you could give me any advice what tool to use for this.
Cheers
Beta Was this translation helpful? Give feedback.
All reactions