package Ġcom . contour . flow of thought . mv vm . repository Ċ Ċ import Ġcom . contour . flow of thought . ol tp . Main DB Ċ import Ġcom . contour . flow of thought . ol tp . model . Image Ċ import Ġcom . contour . flow of thought . ol tp . model . Message Ċ import Ġcom . contour . flow of thought . ol tp . model . Th ought Ċ Ċ class ĠMain Db Repository Ġ{ ĊĠĠĠ Ġprivate Ġval ĠMain Db Ġby Ġlazy Ġ{ ĠMain DB . INSTANCE Ġ} ĊĊĠĠĠ Ġfun Ġsave Th ought ( var arg Ġthought : ĠTh ought ) Ġ{ ĊĠĠĠĠĠĠĠ ĠMain Db . thought Dao (). upsert All (* thought ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġobserve Th ought s () Ġ= ĠMain Db . thought Dao (). get Live All () ĊĊĠĠĠ Ġfun Ġobserve Th ought ById ( id : ĠLong ) Ġ= ĠMain Db . thought Dao (). get Live ById ( id ) ĊĊĠĠĠ Ġfun Ġquery Th ought ById ( id : ĠLong ) Ġ= ĠMain Db . thought Dao (). getById ( id ) ĊĊĠĠĠ Ġfun Ġremove Th ought ( var arg Ġthought : ĠTh ought ) Ġ{ ĊĠĠĠĠĠĠĠ ĠMain Db . thought Dao (). delete (* thought ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġremove Th ought ById ( id : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ ĠMain Db . thought Dao (). delete ById ( id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsave Message ( var arg Ġmessage : ĠMessage ) Ġ{ ĊĠĠĠĠĠĠĠ ĠMain Db . message Dao (). upsert All (* message ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġobserve Messages () Ġ= ĠMain Db . message Dao (). get Live All () ĊĊĠĠĠ Ġfun Ġquery Messages By Th ought Id ( id : ĠLong ) Ġ= ĠMain Db . message Dao (). getAll By Th ought Id ( id ) ĊĊĠĠĠ Ġfun Ġobserve Messages By Th ought Id ( id : ĠLong ) Ġ= ĠMain Db . message Dao (). get Live All By Th ought Id ( id ) ĊĊĠĠĠ Ġfun Ġobserve First Messages By Th ought Id () Ġ= ĠMain Db . message Dao (). get Live First By Th ought Id () ĊĊĠĠĠ Ġfun Ġremove Message ( var arg Ġmessage : ĠMessage ) Ġ{ ĊĠĠĠĠĠĠĠ ĠMain Db . message Dao (). delete (* message ) ĊĠĠĠ Ġ} Ċ }