refactor: Use @MapColumn instead of @MapInfo (#319)

`@MapInfo` is deprecated, migrate to `@MapColumn`.
This commit is contained in:
Nik Clayton 2023-12-13 16:44:50 +01:00 committed by GitHub
parent 341415bc1e
commit e24ef0b52d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ package app.pachli.core.database.dao
import androidx.paging.PagingSource import androidx.paging.PagingSource
import androidx.room.Dao import androidx.room.Dao
import androidx.room.Insert import androidx.room.Insert
import androidx.room.MapInfo import androidx.room.MapColumn
import androidx.room.OnConflictStrategy.Companion.REPLACE import androidx.room.OnConflictStrategy.Companion.REPLACE
import androidx.room.Query import androidx.room.Query
import androidx.room.Upsert import androidx.room.Upsert
@ -263,14 +263,14 @@ WHERE timelineUserId = :accountId AND (serverId = :statusId OR reblogServerId =
* @param serverIds the IDs of the statuses to check * @param serverIds the IDs of the statuses to check
* @return Map between serverIds and any cached viewdata for those statuses * @return Map between serverIds and any cached viewdata for those statuses
*/ */
@MapInfo(keyColumn = "serverId")
@Query( @Query(
"""SELECT * """SELECT *
FROM StatusViewDataEntity FROM StatusViewDataEntity
WHERE timelineUserId = :accountId WHERE timelineUserId = :accountId
AND serverId IN (:serverIds)""", AND serverId IN (:serverIds)""",
) )
abstract suspend fun getStatusViewData(accountId: Long, serverIds: List<String>): Map<String, StatusViewDataEntity> abstract suspend fun getStatusViewData(accountId: Long, serverIds: List<String>):
Map<@MapColumn(columnName = "serverId") String, StatusViewDataEntity>
@Query( @Query(
"""UPDATE TimelineStatusEntity SET pinned = :pinned """UPDATE TimelineStatusEntity SET pinned = :pinned