Created
May 22, 2017 02:07
-
-
Save skyisle/b7f362ab36c7fc8883323b48bf53930c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@android.arch.persistence.room.Dao() | |
public abstract interface UserDao { | |
@android.arch.persistence.room.Insert(onConflict = 1) | |
public abstract void save(@org.jetbrains.annotations.NotNull() | |
com.the42apps.newarch.User p0); | |
@org.jetbrains.annotations.NotNull() | |
@android.arch.persistence.room.Query(value = “SELECT * FROM user WHERE id = :userId”) | |
public abstract android.arch.lifecycle.LiveData<com.the42apps.newarch.User> load(@org.jetbrains.annotations.NotNull() | |
java.lang.String p0); | |
} |
This file contains hidden or 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
@Dao | |
interface UserDao { | |
@Insert(onConflict = REPLACE) | |
fun save(user: User) | |
@Query(“SELECT * FROM user WHERE id = :userId”) | |
fun load(userId: @ParameterName(“userId”) String): LiveData<User> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment