Skip to content

Instantly share code, notes, and snippets.

@tolmachevroman
Last active November 26, 2017 05:12
Show Gist options
  • Save tolmachevroman/673ea92d3981c5de1a64ccf17afe0320 to your computer and use it in GitHub Desktop.
Save tolmachevroman/673ea92d3981c5de1a64ccf17afe0320 to your computer and use it in GitHub Desktop.
Medium Post 1. RestaurantsDao
@Dao
interface RestaurantsDao {
@Query("SELECT * FROM restaurant")
fun queryRestaurants(): LiveData<List<Restaurant>>
@Query("SELECT * FROM restaurant WHERE cuisine LIKE :cuisine")
fun queryRestaurantsByCuisine(cuisine: Int): LiveData<List<Restaurant>>
@Insert(onConflict = REPLACE)
fun insertRestaurant(restaurant: Restaurant)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment