cloudroam
2025-02-25 0fce8fea0b83afb02b5d8780160787e87b8ceedb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.example.firstapp.database.dao
 
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.example.firstapp.database.entity.KeywordConfig
import com.example.firstapp.database.entity.KeywordEntity
 
//@Dao
//interface KeywordDao {
//    @Query("SELECT * FROM keywords")
//     fun getAllKeywords(): List<KeywordEntity>
//
//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    suspend fun insertAll(keywords: List<KeywordEntity>)
//
//
////
////    @Query("DELETE FROM keywords")
////    suspend fun deleteAll()
////
////    @Update
////    suspend fun update(keyword: KeywordEntity)
////
////    @Query("SELECT * FROM keywords WHERE isEnabled = 1")
////     fun getEnabledKeywords(): List<KeywordConfig>
//}
@Dao
interface KeywordDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
     fun insertAll(keywords: List<KeywordEntity>)
 
    @Query("SELECT * FROM keywords")
     fun getAllKeywords(): List<KeywordEntity>
}