18 lines
575 B
Kotlin
18 lines
575 B
Kotlin
package fr.sanchezm.attestationsCovid19.data.db.dao
|
|
|
|
import androidx.lifecycle.LiveData
|
|
import androidx.room.Dao
|
|
import androidx.room.Insert
|
|
import androidx.room.OnConflictStrategy
|
|
import androidx.room.Query
|
|
import fr.sanchezm.attestationsCovid19.data.db.entity.CURRENT_PROFILE_ID
|
|
import fr.sanchezm.attestationsCovid19.data.db.entity.Profile
|
|
|
|
@Dao
|
|
interface ProfileDao {
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
fun insert(profile: Profile)
|
|
|
|
@Query(value = "SELECT * FROM profile WHERE id = $CURRENT_PROFILE_ID")
|
|
fun getProfile(): LiveData<Profile>
|
|
} |