package Ġcom . son us our av . movies . data . local . dao Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . room . Dao Ċ import Ġandroidx . room . Insert Ċ import Ġandroidx . room . On Conflict Strategy Ċ import Ġandroidx . room . Query Ċ import Ġandroidx . room . Transaction Ċ import Ġcom . son us our av . movies . data . local . model . Movie Ċ import Ġcom . son us our av . movies . data . local . model . Movie Details Ċ Ċ @ Dao Ċ interface ĠMov ies Dao Ġ{ ĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . IGNORE ) ĊĠĠĠ Ġfun Ġinsert Movie ( movie : ĠMovie ) ĊĊĠĠĠ Ġ@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġmovie ĠWHERE Ġmovie . id = Ġ: movie Id ") ĊĠĠĠ Ġfun Ġget Movie ( movie Id : ĠLong ): ĠLive Data < Movie Details ?> ĊĊĠĠĠ Ġ@ get : Query (" SELECT Ġ* ĠFROM Ġmovie ĠWHERE Ġis _ favorite Ġ= Ġ 1 ") ĊĠĠĠ Ġval Ġall Book marked Movies : ĠLive Data < List < Movie >> ĊĊĠĠĠ Ġ@ Query (" UPDATE Ġmovie ĠSET Ġis _ favorite Ġ= Ġ 1 ĠWHERE Ġid Ġ= Ġ: movie Id ") ĊĠĠĠ Ġfun Ġbookmark Movie ( movie Id : ĠLong ): ĠInt ĊĊĠĠĠ Ġ@ Query (" UPDATE Ġmovie ĠSET Ġis _ favorite Ġ= Ġ 0 ĠWHERE Ġid Ġ= Ġ: movie Id ") ĊĠĠĠ Ġfun Ġun bookmark Movie ( movie Id : ĠLong ): ĠInt Ċ }