Created
July 23, 2017 17:01
-
-
Save chyrta/e58cabb0660987b058a91db940d68ab7 to your computer and use it in GitHub Desktop.
TokenDaoNew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.arch.persistence.room.Dao; | |
import android.arch.persistence.room.Insert; | |
import android.arch.persistence.room.OnConflictStrategy; | |
import android.arch.persistence.room.Query; | |
@Dao | |
public interface ApiTokenDao { | |
@Query("SELECT * FROM token LIMIT 1") | |
TokenEntity getToken(); | |
@Insert(onConflict = OnConflictStrategy.REPLACE) | |
void saveToken(TokenEntity token); | |
@Query("DELETE FROM token") | |
void truncateTable(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment