package xn.xxp.room.dao;

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

import java.util.List;

import xn.xxp.room.bean.Face;


@Dao
public interface FaceDao {
    @Query("SELECT * FROM face")
    List<Face> getAll();

    @Query("SELECT * FROM face WHERE userId = :userId")
    Face getById(long userId);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insertAll(Face... users);

    @Delete
    void delete(Face user);

    @Query("DELETE FROM face WHERE userId=:userId")
    void delete(long userId);

    @Query("DELETE FROM face")
    void clear();
}
