This is how I am inserting data into database using Room Persistence Library:
Entity:
@Entity class User { @PrimaryKey(autoGenerate = true) p
Based on the documentation here (below the code snippet)
A method annotated with the @Insert annotation can return:
@Insert
long for single insert operation long[] or Long[] or List<Long> for multiple insert operations void if you don't care about the inserted id(s)
long
long[]
Long[]
List<Long>
void