package suda.sudamodweather.dao.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.DaoConfig;
import suda.sudamodweather.dao.greendao.HourForeCast;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "HOUR_FORE_CAST".
*/
public class HourForeCastDao extends AbstractDao<HourForeCast, Void> {
public static final String TABLENAME = "HOUR_FORE_CAST";
/**
* Properties of entity HourForeCast.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Areaid = new Property(0, String.class, "areaid", false, "AREAID");
public final static Property Hour = new Property(1, String.class, "hour", false, "HOUR");
public final static Property WeatherCondition = new Property(2, String.class, "weatherCondition", false, "WEATHER_CONDITION");
public final static Property Temp = new Property(3, Integer.class, "temp", false, "TEMP");
};
public HourForeCastDao(DaoConfig config) {
super(config);
}
public HourForeCastDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"HOUR_FORE_CAST\" (" + //
"\"AREAID\" TEXT," + // 0: areaid
"\"HOUR\" TEXT," + // 1: hour
"\"WEATHER_CONDITION\" TEXT," + // 2: weatherCondition
"\"TEMP\" INTEGER);"); // 3: temp
}
/** Drops the underlying database table. */
public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"HOUR_FORE_CAST\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, HourForeCast entity) {
stmt.clearBindings();
String areaid = entity.getAreaid();
if (areaid != null) {
stmt.bindString(1, areaid);
}
String hour = entity.getHour();
if (hour != null) {
stmt.bindString(2, hour);
}
String weatherCondition = entity.getWeatherCondition();
if (weatherCondition != null) {
stmt.bindString(3, weatherCondition);
}
Integer temp = entity.getTemp();
if (temp != null) {
stmt.bindLong(4, temp);
}
}
/** @inheritdoc */
@Override
public Void readKey(Cursor cursor, int offset) {
return null;
}
/** @inheritdoc */
@Override
public HourForeCast readEntity(Cursor cursor, int offset) {
HourForeCast entity = new HourForeCast( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // areaid
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // hour
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // weatherCondition
cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3) // temp
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, HourForeCast entity, int offset) {
entity.setAreaid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setHour(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setWeatherCondition(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setTemp(cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3));
}
/** @inheritdoc */
@Override
protected Void updateKeyAfterInsert(HourForeCast entity, long rowId) {
// Unsupported or missing PK type
return null;
}
/** @inheritdoc */
@Override
public Void getKey(HourForeCast entity) {
return null;
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}