Android room persistent: AppDatabase_Impl does not exist

前端 未结 21 1483
日久生厌
日久生厌 2020-11-29 01:09

My app database class

@Database(entities = {Detail.class}, version = Constant.DATABASE_VERSION)
public abstract class AppDatabase extends RoomDatabase {

            


        
21条回答
  •  余生分开走
    2020-11-29 01:26

    I meet with the problem, because I forget @Dao annotation

    @Dao
    public interface SearchHistoryDao {
        @Query("SELECT * FROM search_history")
        List getAll();
    
        @Insert
        void insertAll(SearchHistory... histories);
    
        @Delete()
        void delete(SearchHistory history);
    }
    

    Room Official tutorial

提交回复
热议问题