I'm using Room for my android app. I'm now trying to setup my database, but there is an error message, which says, that the Dao class must be annotated with @Dao. But as you can see in the coding snippet, the Dao class is annotated with @Dao. Does anyone know where the problem or my mistake could be? Both files aren't in the same folder (DAO is in the service folder while the other class is in the model folder)
Device.java
@Entity(tableName = "device")
public class Device {
@PrimaryKey(autoGenerate = true)
public int device_id;
@ColumnInfo(name = "identifier")
public String identifier;
@ColumnInfo(name = "language")
public int language;
@ColumnInfo(name = "searchFilter")
public int searchFilter;
public Device(String identifier, int language, int searchFilter){
this.identifier = identifier;
this.language = language;
this.searchFilter = searchFilter;
}
}
DeviceDAO.java
@Dao
public interface DeviceDAO {
@Insert(onConflict = OnConflictStrategy.REPLACE)
void addDevicePreferences(DifficultType difficultType);
@Query("SELECT * FROM device")
List<Device> selectAllDevicePreferences();
@Update(onConflict = OnConflictStrategy.REPLACE)
void updateDevicePreferences(Device device);
}
RoomDatabasesubclass perhaps have anabstractmethod that is returning something other thanDeviceDAO?