Based on the documentation here (below the code snippet)
A method annotated with the @Insert
annotation can return:
long
for single insert operationlong[]
orLong[]
orList<Long>
for multiple insert operationsvoid
if you don’t care about the inserted id(s)
More Related Contents:
- Android Room – simple select query – Cannot access database on the main thread
- Android Persistence room: “Cannot figure out how to read this field from a cursor”
- Android Room: Insert relation entities using Room
- Room Persistence: Error:Entities and Pojos must have a usable public constructor
- How to use Room Persistence Library with pre-populated database?
- Android room persistent library – TypeConverter error of error: Cannot figure out how to save field to database”
- How to dynamically query the room database at runtime?
- Room – LiveData observer does not trigger when database is updated
- Android room persistent library – how to insert class that has a List object field
- Android Room – Select query with LIKE
- How can I represent a “many to many” relation with Android Room when column names are same?
- How to populate Android Room database table on first run?
- Room cannot verify the data integrity
- Return type for Android Room joins
- How to get rid of Incremental annotation processing requested warning?
- How to save enum field in the database room?
- How insert image in room persistence library?
- Room : LiveData from Dao will trigger Observer.onChanged on every Update, even if the LiveData value has no change
- How to make primary key as autoincrement for Room Persistence lib
- LiveData remove Observer after first callback
- How to combine two live data one after the other?
- Backup Room database
- Read logcat programmatically within application
- Android: How can I Convert String to Date?
- onRequestPermissionsResult not being called in fragment if defined in both fragment and activity
- Android Volley double post when have slow request
- What is the use case for @Binds vs @Provides annotation in Dagger2
- How to programmatically pair a bluetooth device on Android
- Program type already present: android.support.v4.app.BackStackRecord
- Android GCM and multiple tokens