I use @Query to delete a row in the My Room database, but I cannot delete the entry. Here is my request from @Dao
@Dao public interface NoteDao { @Insert void insert(final Note note); @Update void update(final Note note); @Query("DELETE FROM notes WHERE uid = :noteId") int delete(final int noteId); @Query("SELECT * FROM notes") LiveData<List<Note>> selectAll(); }
Entity class
@Entity(tableName = "notes") public class Note { @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") @Expose(serialize = false, deserialize = false) private int mId; @ColumnInfo(name = "uid") @SerializedName("id") private int mUid; @ColumnInfo(name = "text") @SerializedName("text") private String mText; public Note() { } getters and setters ommited }
Can someone give me advice on what I'm doing wrong?
source share