使用房间(1)靠近"?"时更新项目列表时出现语法错误:语法错误)



my error:

databaseE/SQLiteLog: (1) near "?": update posts_table中的语法错误Set list = ?,?其中id= ?">

我代码:

@Query("update posts_table set list = :list where id= :id")
Completable updatePost(int id, ArrayList<Integer> list);

这样写

@Query("update posts_table set list = :list where id= :id")
void updatePost(ArrayList list,int id);

我建议您将arraylist转换为string,然后在db中添加数据不要直接添加数组列表

最新更新