76.3 Building the Entity
This project will begin by creating the entity which defines the schema for the database table. The entity will consist of an integer for the product id, a string column to hold the product name and another integer value to store the quantity. The product id column will serve as the primary key and will be auto-generated. Table 76-6 summarizes the structure of the entity:
Column |
Data Type |
productid |
Integer / Primary Key / Auto Increment |
productname |
String |
productquantity |
Integer |
Table 76-6
Add a class file for the entity by right clicking on the app -> java -> com.ebookfrenzy.roomdemo entry in the Project tool window and selecting the New -> Kotlin File/Class menu option. In the new class...