67.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 new class dialog, enter ProductDao into the Name field and select Interface from the list as highlighted in Figure 67-1:
Figure 67-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("SELECT...