package com.example.mynotepad.MenuFeatures.AllNotes.DataBase;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface NoteDAO {

    // a method list type
    @Query("SELECT * FROM Note")
    List<Note> getAll();

    //insert data in database
    @Insert
    void insertNote(Note myNewNote);

    @Delete
    void deleteNote(Note myNote);


    @Query("UPDATE Note SET title = :title , description = :description ,archived = :isarchived  Where ID = :id")
    void updateNote(String title , String description , boolean isarchived , int id);



}