66.4 Creating the Data Access Object
With the product entity defined, the next step is to create the DAO interface. Referring once again to the Project tool window, right-click on the app -> java -> com.ebookfrenzy.roomdemo entry and select the New -> Java Class menu option. In the Create New Class dialog, enter ProductDao into the Name field and select Interface from the Kind menu as highlighted in Figure 66-1:
Figure 66-1
Click on OK to generate the new interface and, with the ProductDao.java file loaded into the code editor, make the following changes:
package com.ebookfrenzy.roomdemo;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import java.util.List;
@Dao
public interface ProductDao {
@Insert
void insertProduct(Product product);
@Query...