package Ġcom . tech nip ix l . fil rouge . DB Food . Dao Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . room .* Ċ import Ġcom . tech nip ix l . fil rouge . DB Food . model . Bus inese Db Ċ import Ġcom . tech nip ix l . fil rouge . DB Food . model . Business with Category Ċ import Ġcom . tech nip ix l . fil rouge . DB Food . model . Category Db Ċ Ċ @ Dao Ċ interface ĠFood Dao Ġ{ ĊĠĠĠ Ġ@ Query (" Select Ġ* ĠFrom ĠBus inese Db ĠWHERE Ġchoice Number Ġ= Ġ: choice Number ") ĊĠĠĠ Ġfun Ġget Favorite Food ( choice Number : Int ): ĠLive Data < List < Business with Category >> ĊĠĠĠ Ġ@ Query (" Select Ġ* ĠFrom ĠBus inese Db ") ĊĠĠĠ Ġsuspend Ġfun Ġget Favorite Food Bus i (): ĠList < Bus inese Db > ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert Data Food ( bus inese Db : ĠBus inese Db ): ĠLong ĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert Data Category ( category Db : ĠCategory Db ): Long ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM ĠBus inese Db ĠWHERE Ġid ĠLIKE Ġ: id ĠLIMIT Ġ 1 ") ĊĠĠĠ Ġfun Ġget ById ( id : ĠString ): ĠLive Data < Bus inese Db > ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġbus inese db ĠWHERE Ġid Ġ= Ġ: id ") ĊĠĠĠ Ġfun Ġdelete ById ( id : ĠString ) Ċ }