Sign in Go Pro

Storing Data in Android with Room

Updating an entity using the @Update annotation

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



In this lesson, we'll describe how to update entities from a Room database using the @Update annotation.

We'll show how @Update can be used to update tasks from our database.

We'll also show what the equivalent full SQLite @Query would look like. This will highlight how much less code is required to update an entity when using the @Update annotation.

Summary of Content:

  • Defining a function which uses @Update annotation
  • How to provide the task to be updated
  • What the equivalent full update SQL query would be if using @Query
  • When you might prefer to use the full @Query approach instead of @Update





There are no comments on this lesson, start the conversation below ...


Lessons in Storing Data in Android with Room