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 DateNoreDAO {

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

    //insert data in database
    @Insert
    void insertDateNote(DateEntity dateEntity);

    //delete data in database
    @Delete
    void deleteDateNote(DateEntity dateEntity);


    //update data
    @Query("UPDATE DateEntity SET date = :date , description = :description ,archived = :isarchived  Where ID = :id")
    void updateDate(String date , String description , boolean isarchived , int id);
}
