Search in sources :

Example 1 with CurWeatherModel

use of tk.woppo.sunday.model.CurWeatherModel in project SunDay by iQuick.

the class WeatherCurDataHelper method query.

public CurWeatherModel query(String id) {
    CurWeatherModel model = null;
    Cursor cursor = query(null, WeatherCurDBInfo.ID + " = ?", new String[] { id }, null);
    if (cursor.moveToFirst()) {
        model = CurWeatherModel.fromCursor(cursor);
    }
    cursor.close();
    return model;
}
Also used : Cursor(android.database.Cursor) CurWeatherModel(tk.woppo.sunday.model.CurWeatherModel)

Example 2 with CurWeatherModel

use of tk.woppo.sunday.model.CurWeatherModel in project SunDay by iQuick.

the class WeatherCurDataHelper method bulkInsert.

public void bulkInsert(List<CurWeatherModel> models) {
    ArrayList<ContentValues> contentValueses = new ArrayList<ContentValues>();
    for (CurWeatherModel model : models) {
        ContentValues values = getContentValues(model);
        contentValueses.add(values);
    }
    ContentValues[] valueArray = new ContentValues[contentValueses.size()];
    bulkInsert(contentValueses.toArray(valueArray));
}
Also used : ContentValues(android.content.ContentValues) ArrayList(java.util.ArrayList) CurWeatherModel(tk.woppo.sunday.model.CurWeatherModel)

Aggregations

CurWeatherModel (tk.woppo.sunday.model.CurWeatherModel)2 ContentValues (android.content.ContentValues)1 Cursor (android.database.Cursor)1 ArrayList (java.util.ArrayList)1