1 package name.gumartinm.weather.information.model;
3 import android.content.Context;
5 public class DatabaseQueries {
6 private final Context localContext;
8 public DatabaseQueries(final Context context) {
9 this.localContext = context;
12 public WeatherLocation queryDataBase() {
14 final WeatherLocationDbHelper dbHelper = new WeatherLocationDbHelper(this.localContext);
16 final WeatherLocationDbQueries queryDb = new WeatherLocationDbQueries(dbHelper);
17 return queryDb.queryDataBase();
23 public long insertIntoDataBase(final WeatherLocation weatherLocation) {
25 final WeatherLocationDbHelper dbHelper = new WeatherLocationDbHelper(this.localContext);
27 final WeatherLocationDbQueries queryDb = new WeatherLocationDbQueries(dbHelper);
28 return queryDb.insertIntoDataBase(weatherLocation);
34 public void updateDataBase(final WeatherLocation weatherLocation) {
36 final WeatherLocationDbHelper dbHelper = new WeatherLocationDbHelper(this.localContext);
38 final WeatherLocationDbQueries queryDb = new WeatherLocationDbQueries(dbHelper);
39 queryDb.updateDataBase(weatherLocation);