29 lines
644 B
Java
29 lines
644 B
Java
package at.fhj.swd.dailyhelper.db.room;
|
|
|
|
import android.arch.persistence.room.Dao;
|
|
import android.arch.persistence.room.Insert;
|
|
import android.arch.persistence.room.OnConflictStrategy;
|
|
import android.arch.persistence.room.Query;
|
|
|
|
import java.util.List;
|
|
|
|
import at.fhj.swd.dailyhelper.model.Weather;
|
|
|
|
|
|
@Dao
|
|
public interface WeatherDAO {
|
|
|
|
@Query("SELECT * FROM weather")
|
|
List<Weather> getAll();
|
|
|
|
|
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
void addWeather(Weather weather);
|
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
void addAll(List<Weather> weathers);
|
|
|
|
@Query("DELETE FROM weather")
|
|
void clear();
|
|
} |