package com.ccwangluo.ccim.database;

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

import com.ccwangluo.ccim.modle.MessageContent;

import java.util.List;

@Dao
public interface MessageDao {
    @Query("SELECT * FROM messagecontent")
    List<MessageContent> getAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(MessageContent messageContent);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insertList(List<MessageContent> messageContents);

    @Query("SELECT * FROM messagecontent where msgId = :msgId")
    MessageContent getMsgById(Long msgId);
}
