这是Room Db Dao设置,我用于存储和检索数据。有人帮我告诉我,这里有没有鱼。运行getUser()
时得到空值。我只有一个用户来保存更新和检索。
@Dao
interface UserDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insert(userEntity: UserEntity): Long
@Update
fun update(userEntity: UserEntity): Int
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)
@Query("SELECT 'first',* FROM usertable ORDER BY id DESC" )
fun getUser(): UserEntity
@Query("DELETE from usertable")
fun remUser(): Int
}
谢谢