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.WeekForeCast; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "WEEK_FORE_CAST". */ public class WeekForeCastDao extends AbstractDao<WeekForeCast, Void> { public static final String TABLENAME = "WEEK_FORE_CAST"; /** * Properties of entity WeekForeCast.<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 WeatherDate = new Property(1, java.util.Date.class, "weatherDate", false, "WEATHER_DATE"); public final static Property WeatherConditionStart = new Property(2, String.class, "weatherConditionStart", false, "WEATHER_CONDITION_START"); public final static Property WeatherConditionEnd = new Property(3, String.class, "weatherConditionEnd", false, "WEATHER_CONDITION_END"); public final static Property TempH = new Property(4, Integer.class, "tempH", false, "TEMP_H"); public final static Property TempL = new Property(5, Integer.class, "tempL", false, "TEMP_L"); public final static Property Fx = new Property(6, String.class, "fx", false, "FX"); public final static Property Fj = new Property(7, String.class, "fj", false, "FJ"); public final static Property RainPerCent = new Property(8, Integer.class, "rainPerCent", false, "RAIN_PER_CENT"); }; public WeekForeCastDao(DaoConfig config) { super(config); } public WeekForeCastDao(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 + "\"WEEK_FORE_CAST\" (" + // "\"AREAID\" TEXT," + // 0: areaid "\"WEATHER_DATE\" INTEGER," + // 1: weatherDate "\"WEATHER_CONDITION_START\" TEXT," + // 2: weatherConditionStart "\"WEATHER_CONDITION_END\" TEXT," + // 3: weatherConditionEnd "\"TEMP_H\" INTEGER," + // 4: tempH "\"TEMP_L\" INTEGER," + // 5: tempL "\"FX\" TEXT," + // 6: fx "\"FJ\" TEXT," + // 7: fj "\"RAIN_PER_CENT\" INTEGER);"); // 8: rainPerCent } /** Drops the underlying database table. */ public static void dropTable(SQLiteDatabase db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"WEEK_FORE_CAST\""; db.execSQL(sql); } /** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, WeekForeCast entity) { stmt.clearBindings(); String areaid = entity.getAreaid(); if (areaid != null) { stmt.bindString(1, areaid); } java.util.Date weatherDate = entity.getWeatherDate(); if (weatherDate != null) { stmt.bindLong(2, weatherDate.getTime()); } String weatherConditionStart = entity.getWeatherConditionStart(); if (weatherConditionStart != null) { stmt.bindString(3, weatherConditionStart); } String weatherConditionEnd = entity.getWeatherConditionEnd(); if (weatherConditionEnd != null) { stmt.bindString(4, weatherConditionEnd); } Integer tempH = entity.getTempH(); if (tempH != null) { stmt.bindLong(5, tempH); } Integer tempL = entity.getTempL(); if (tempL != null) { stmt.bindLong(6, tempL); } String fx = entity.getFx(); if (fx != null) { stmt.bindString(7, fx); } String fj = entity.getFj(); if (fj != null) { stmt.bindString(8, fj); } Integer rainPerCent = entity.getRainPerCent(); if (rainPerCent != null) { stmt.bindLong(9, rainPerCent); } } /** @inheritdoc */ @Override public Void readKey(Cursor cursor, int offset) { return null; } /** @inheritdoc */ @Override public WeekForeCast readEntity(Cursor cursor, int offset) { WeekForeCast entity = new WeekForeCast( // cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // areaid cursor.isNull(offset + 1) ? null : new java.util.Date(cursor.getLong(offset + 1)), // weatherDate cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // weatherConditionStart cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // weatherConditionEnd cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4), // tempH cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // tempL cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // fx cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // fj cursor.isNull(offset + 8) ? null : cursor.getInt(offset + 8) // rainPerCent ); return entity; } /** @inheritdoc */ @Override public void readEntity(Cursor cursor, WeekForeCast entity, int offset) { entity.setAreaid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0)); entity.setWeatherDate(cursor.isNull(offset + 1) ? null : new java.util.Date(cursor.getLong(offset + 1))); entity.setWeatherConditionStart(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setWeatherConditionEnd(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setTempH(cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4)); entity.setTempL(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5)); entity.setFx(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setFj(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setRainPerCent(cursor.isNull(offset + 8) ? null : cursor.getInt(offset + 8)); } /** @inheritdoc */ @Override protected Void updateKeyAfterInsert(WeekForeCast entity, long rowId) { // Unsupported or missing PK type return null; } /** @inheritdoc */ @Override public Void getKey(WeekForeCast entity) { return null; } /** @inheritdoc */ @Override protected boolean isEntityUpdateable() { return true; } }