Peter Samokhin
Peter Samokhin

Reputation: 874

Query without plain SQL in Android Room Database

In Android Room database, e.g. to find all users from table, we can:

@Query(“SELECT * FROM Users”)
fun getUsers(): List<User>

But can we get smthing without plain SQL code SELECT * FROM Users ?

In Spring Framework we can, e.g.:

fun findAllUsers(): List<User>

And then we got all necessary users, without SQL code in annotation, but with annotation also can.

The question is: can we get something WITHOUT @Query annotation?

Upvotes: 1

Views: 543

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007534

But can we get smthing without plain SQL code SELECT * FROM Users ?

No.

can we get something WITHOUT @Query annotation?

Also no.

Upvotes: 2

Related Questions