My app database class
@Database(entities = {Detail.class}, version = Constant.DATABASE_VERSION) public abstract class AppDatabase extends RoomDatabase {
I meet with the problem, because I forget @Dao annotation
@Dao
@Dao public interface SearchHistoryDao { @Query("SELECT * FROM search_history") List getAll(); @Insert void insertAll(SearchHistory... histories); @Delete() void delete(SearchHistory history); }
Room Official tutorial