Storing Data in Android with Room
Updating an entity using the @Update annotation
Autoplay
Up next
Previous
About
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
Links:
Instructor
Links
Comments
Lessons in Storing Data in Android with Room
1. Introduction and Integration
01:35
2. Creating the Database

02:23
3. Defining an Entity

02:02
4. Custom SQL Table and Column Names

01:20
5. Creating the Data Access Object (DAO)

Pro
01:50
6. Inserting Entities with the @Insert Annotation

Pro
03:29
7. Reading data using the @Query Annotation

Pro
02:34
8. LiveData

Pro
03:00
9. Passing Parameters into a @Query

Pro
02:23
10. Deleting entities using the @Delete annotation

Pro
02:56
11. Updating an entity using the @Update annotation

Pro
02:32
12. Foreign Key Relationships

Pro
03:55
13. One to Many Relationships

Pro
04:28
14. @Relation annotation

Pro
04:05
15. Many to Many Relationship

Pro
11:25
16. TypeConverter

Pro
02:39
17. Database Migrations

Pro
05:29

Something went wrong
Lesson added to playlist
Create new playlist
Name can't be empty