Android Room Persistence Library - How to find entities with ids contained in list of ids?

后端 未结 2 1357
囚心锁ツ
囚心锁ツ 2021-01-11 13:54

I am trying to do the following query in my DAO.

   @Query(\"SELECT * FROM objects WHERE obj_id IN :ids\")
   List queryObjects(List

        
      
      
      
2条回答
  •  长情又很酷
    2021-01-11 14:24

    You need parentheses:

    @Query("SELECT * FROM objects WHERE obj_id IN (:ids)")
    List queryObjects(List ids);
    
    
    

    (and FWIW, I filed an issue to try to get a better error message here)

    提交回复
    热议问题