package Ġcom . lu uu . se ven . db Ċ Ċ import Ġandroidx . room . Dao Ċ import Ġandroidx . room . Insert Ċ import Ġandroidx . room . Query Ċ import Ġcom . lu uu . se ven . bean . Collect Bean Ċ import Ġkotlinx . coroutines . flow . Flow Ċ Ċ @ Dao Ċ interface ĠCollection Dao Ġ{ ĊĊĠĠĠ Ġ@ Insert ĊĠĠĠ Ġsuspend Ġfun Ġinsert Collection ( collect Bean : ĠCollect Bean ) ĊĊĠĠĠ Ġ@ Query (" select Ġexists ( select Ġ* Ġfrom Ġcom ic _ collect Ġwhere Ġcom ic _ id Ġ= Ġ: com ic Id )") ĊĠĠĠ Ġfun Ġget Collection ById ( com ic Id : ĠInt ): ĠFlow < Boolean > ĊĊĠĠĠ Ġ@ Query (" delete Ġfrom Ġcom ic _ collect Ġwhere Ġcom ic _ id Ġ= Ġ: com ic Id ") ĊĠĠĠ Ġsuspend Ġfun Ġcancel Collection ( com ic Id : ĠInt ) ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom Ġcom ic _ collect ") ĊĠĠĠ Ġfun Ġget Collection Data (): ĠFlow < List < Collect Bean >> Ċ }