package Ġcom . h ari . t mdb . db . internal . da os Ċ Ċ import Ġandroidx . paging . DataSource Ċ import Ġandroidx . room . Dao Ċ import Ġandroidx . room . Query Ċ import Ġandroidx . room . Transaction Ċ import Ġcom . h ari . t mdb . db . internal . entity . Pop ular Movie Entity Ċ import Ġcom . h ari . t mdb . db . internal . result entities . Pop ular Entry With Movie Ċ import Ġcom . h ari . t mdb . model . Movie Category Ċ import Ġkotlinx . coroutines . flow . Flow Ċ Ċ @ Dao Ċ abstract Ġclass ĠPop ular Movie Dao Ġ: ĠPag inated Entry Dao < Pop ular Movie Entity , ĠPop ular Entry With Movie >() Ġ{ ĊĊĠĠĠ Ġ@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġpopular _ movies ĠWHERE Ġpage Ġ= Ġ: page ĠORDER ĠBY Ġpage _ order ") ĊĠĠĠ Ġabstract Ġfun Ġentries Observable ( page : ĠInt ): ĠFlow < List < Pop ular Movie Entity >> ĊĊĠĠĠ Ġ@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġpopular _ movies ĠORDER ĠBY Ġpage , Ġpage _ order ") ĊĠĠĠ Ġabstract Ġfun Ġentries Observable (): ĠFlow < List < Pop ular Entry With Movie >> ĊĊĠĠĠ Ġ@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġpopular _ movies ĠWHERE Ġmovie _ category Ġ= : movie Category ĠORDER ĠBY Ġpage , Ġpage _ order ") ĊĠĠĠ Ġabstract Ġfun Ġentries Observable ( movie Category : ĠMovie Category ): ĠFlow < List < Pop ular Entry With Movie >> ĊĊĠĠĠ Ġ@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġpopular _ movies ĠWHERE Ġmovie _ category Ġ= : movie Category ĠORDER ĠBY Ġpage , Ġpage _ order ") ĊĠĠĠ Ġabstract Ġfun ĠdataSource ( movie Category : ĠMovie Category ): ĠDataSource . Factory < Int , ĠPop ular Entry With Movie > ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġpopular _ movies ĠWHERE Ġpage Ġ= Ġ: page ") ĊĠĠĠ Ġabstract Ġoverride Ġsuspend Ġfun Ġdelete Page ( page : ĠInt ) ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġpopular _ movies ") ĊĠĠĠ Ġabstract Ġoverride Ġsuspend Ġfun Ġdelete All () ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġpopular _ movies ĠWHERE Ġmovie _ category Ġ= : movie Category ") ĊĠĠĠ Ġabstract Ġsuspend Ġfun Ġdelete All ( movie Category : ĠMovie Category ) ĊĊĠĠĠ Ġ@ Query (" SELECT ĠMAX ( page ) Ġfrom Ġpopular _ movies ") ĊĠĠĠ Ġabstract Ġoverride Ġsuspend Ġfun ĠgetLast Page (): ĠInt ? ĊĊĠĠĠ Ġ@ Query (" SELECT ĠMAX ( page ) Ġfrom Ġpopular _ movies ĠWHERE Ġmovie _ category Ġ= : movie Category ĠAND Ġmovie _ id Ġ= : id ") ĊĠĠĠ Ġabstract Ġsuspend Ġfun ĠgetLast Page ( id : ĠInt , Ġmovie Category : ĠMovie Category ): ĠInt ? Ċ }