Skip to content

Instantly share code, notes, and snippets.

@Elbar
Created July 22, 2020 08:22
Show Gist options
  • Save Elbar/fabde33855fba4d39e45fc8ee6506455 to your computer and use it in GitHub Desktop.
Save Elbar/fabde33855fba4d39e45fc8ee6506455 to your computer and use it in GitHub Desktop.
package com.example.db.dao
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.example.model.Account
@Dao
interface AccountDao {
@Query("SELECT * FROM account")
fun getAccountInfo(): Account?
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertAccountInfo(accountInfo: Account)
@Query("DELETE FROM account")
fun clearAllData()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment