package Ġio . github . ro zza . todo 2 done . room Ċ Ċ import Ġandroid . arch . persistence . room . Dao Ċ import Ġandroid . arch . persistence . room . Delete Ċ import Ġandroid . arch . persistence . room . Insert Ċ import Ġandroid . arch . persistence . room . On Conflict Strategy Ċ import Ġandroid . arch . persistence . room . Query Ċ import Ġandroid . arch . persistence . room . Update Ċ import Ġio . reactivex . Flow able Ċ Ċ @ Dao Ċ interface ĠTodo Dao Ġ{ ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġfun Ġcreate Item ( user : ĠTodo Entity ) ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġ$ TABLE _ NAME ") ĊĠĠĠ Ġfun ĠfindAll (): ĠFlow able < List < Todo Entity >> ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġ$ TABLE _ NAME ĠWHERE Ġdate _ completed Ġ> Ġ 0 ") ĊĠĠĠ Ġfun ĠfindAll Completed (): ĠFlow able < List < Todo Entity >> ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġ$ TABLE _ NAME ĠWHERE Ġdate _ completed Ġ= Ġ 0 ") ĊĠĠĠ Ġfun ĠfindAll Out standing (): ĠFlow able < List < Todo Entity >> ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġ$ TABLE _ NAME ĠWHERE Ġid Ġ= Ġ: id ") ĊĠĠĠ Ġfun Ġfind Item ById ( id : ĠLong ): ĠFlow able < Todo Entity > ĊĊĠĠĠ Ġ@ Update ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġfun Ġupdate Item ( item : ĠTodo Entity ) ĊĊĠĠĠ Ġ@ Delete ĊĠĠĠ Ġfun Ġdelete Item ( item : ĠTodo Entity ) Ċ }