5.4 Entities
Anatomy of an entity
@Entity // Can use @Entity(tableName = "<CUSTOM_NAME>") to change the table name.
data class GroceryItem(@PrimaryKey val item: String,
val brand: String,
@ColumnInfo(name = "cost") val number: Int // Can use @ColumnInfo to define your column name differently.
)Last updated
Was this helpful?