Android 房间数据库中没有纯 SQL 的查询
Query without plain SQL in Android Room Database
在Android房间数据库中,例如要查找 table 中的所有用户,我们可以:
@Query(“SELECT * FROM Users”)
fun getUsers(): List<User>
但是如果没有简单的 SQL 代码 SELECT * FROM Users
我们能得到 smth 吗?
在Spring框架中我们可以,例如:
fun findAllUsers(): List<User>
然后我们得到了所有需要的用户,注释中没有SQL代码,但是有注释也可以。
问题是:我们可以得到没有 @Query
注释的东西吗?
But can we get smthing without plain SQL code SELECT * FROM Users ?
没有
can we get something WITHOUT @Query annotation?
也没有
在Android房间数据库中,例如要查找 table 中的所有用户,我们可以:
@Query(“SELECT * FROM Users”)
fun getUsers(): List<User>
但是如果没有简单的 SQL 代码 SELECT * FROM Users
我们能得到 smth 吗?
在Spring框架中我们可以,例如:
fun findAllUsers(): List<User>
然后我们得到了所有需要的用户,注释中没有SQL代码,但是有注释也可以。
问题是:我们可以得到没有 @Query
注释的东西吗?
But can we get smthing without plain SQL code SELECT * FROM Users ?
没有
can we get something WITHOUT @Query annotation?
也没有