When i write a code according to other page it gives an error "unresolved reference in RoomSQL"
here are my codes:
@Entity(tableName = "notes")
public class Notes implements Serializable {
@PrimaryKey(autoGenerate = true)
int ID = 0;
@ColumnInfo(name = "title")
String title = "";
@ColumnInfo(name = "notes")
String notes = "";
@ColumnInfo(name = "date")
String date = "";
@ColumnInfo(name = "pinned")
boolean pinned = false;
public int getID() {
return ID;
}
public void setID(int ID) {
this.ID = ID;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public boolean isPinned() {
return pinned;
}
public void setPinned(boolean pinned) {
this.pinned = pinned;
}
so when i try to write "notes" in other tab it says "unresolved"
here are my codes:
public interface MainDAO {
@Insert(onConflict = REPLACE)
void insert(Notes notes);
@Query("SELECT * FROM notes ORDER BY id DESC")
List<Notes> getAll();
@Query("UPDATE notes SET title = :title, notes = :notes WHERE ID = :id")
void update(int id, String title, String notes);
@Delete
void delete(Notes notes);
}
error is on 6. and 9. line