Created
September 22, 2019 11:54
-
-
Save zainfikrih/cd585a61ea6b3bbc5a012acaa3bcdaf0 to your computer and use it in GitHub Desktop.
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
package men.ngopi.zain.catatanku.local.room; | |
import androidx.lifecycle.LiveData; | |
import androidx.room.Dao; | |
import androidx.room.Delete; | |
import androidx.room.Insert; | |
import androidx.room.OnConflictStrategy; | |
import androidx.room.Query; | |
import androidx.room.Update; | |
import java.util.List; | |
import men.ngopi.zain.catatanku.local.entity.NoteEntity; | |
@Dao | |
public interface CatatankuDao { | |
@Insert(onConflict = OnConflictStrategy.IGNORE) | |
void insert(NoteEntity noteEntity); | |
@Update() | |
void update(NoteEntity noteEntity); | |
@Delete() | |
void delete(NoteEntity noteEntity); | |
@Query("SELECT * from NoteEntity ORDER BY id DESC") | |
LiveData<List<NoteEntity>> getNotes(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment