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.Alarms; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "ALARMS". */ public class AlarmsDao extends AbstractDao<Alarms, Void> { public static final String TABLENAME = "ALARMS"; /** * Properties of entity Alarms.<br/> * Can be used for QueryBuilder and for referencing column names. */ public static class Properties { public final static Property AlarmContent = new Property(0, String.class, "alarmContent", false, "ALARM_CONTENT"); public final static Property AlarmId = new Property(1, String.class, "alarmId", false, "ALARM_ID"); public final static Property AlarmLevelNo = new Property(2, String.class, "alarmLevelNo", false, "ALARM_LEVEL_NO"); public final static Property AlarmLevelNoDesc = new Property(3, String.class, "alarmLevelNoDesc", false, "ALARM_LEVEL_NO_DESC"); public final static Property AlarmType = new Property(4, String.class, "alarmType", false, "ALARM_TYPE"); public final static Property AlarmTypeDesc = new Property(5, String.class, "alarmTypeDesc", false, "ALARM_TYPE_DESC"); public final static Property PublishTime = new Property(6, String.class, "publishTime", false, "PUBLISH_TIME"); public final static Property Areaid = new Property(7, String.class, "areaid", false, "AREAID"); public final static Property AreaName = new Property(8, String.class, "areaName", false, "AREA_NAME"); }; public AlarmsDao(DaoConfig config) { super(config); } public AlarmsDao(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 + "\"ALARMS\" (" + // "\"ALARM_CONTENT\" TEXT," + // 0: alarmContent "\"ALARM_ID\" TEXT," + // 1: alarmId "\"ALARM_LEVEL_NO\" TEXT," + // 2: alarmLevelNo "\"ALARM_LEVEL_NO_DESC\" TEXT," + // 3: alarmLevelNoDesc "\"ALARM_TYPE\" TEXT," + // 4: alarmType "\"ALARM_TYPE_DESC\" TEXT," + // 5: alarmTypeDesc "\"PUBLISH_TIME\" TEXT," + // 6: publishTime "\"AREAID\" TEXT," + // 7: areaid "\"AREA_NAME\" TEXT);"); // 8: areaName } /** Drops the underlying database table. */ public static void dropTable(SQLiteDatabase db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"ALARMS\""; db.execSQL(sql); } /** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, Alarms entity) { stmt.clearBindings(); String alarmContent = entity.getAlarmContent(); if (alarmContent != null) { stmt.bindString(1, alarmContent); } String alarmId = entity.getAlarmId(); if (alarmId != null) { stmt.bindString(2, alarmId); } String alarmLevelNo = entity.getAlarmLevelNo(); if (alarmLevelNo != null) { stmt.bindString(3, alarmLevelNo); } String alarmLevelNoDesc = entity.getAlarmLevelNoDesc(); if (alarmLevelNoDesc != null) { stmt.bindString(4, alarmLevelNoDesc); } String alarmType = entity.getAlarmType(); if (alarmType != null) { stmt.bindString(5, alarmType); } String alarmTypeDesc = entity.getAlarmTypeDesc(); if (alarmTypeDesc != null) { stmt.bindString(6, alarmTypeDesc); } String publishTime = entity.getPublishTime(); if (publishTime != null) { stmt.bindString(7, publishTime); } String areaid = entity.getAreaid(); if (areaid != null) { stmt.bindString(8, areaid); } String areaName = entity.getAreaName(); if (areaName != null) { stmt.bindString(9, areaName); } } /** @inheritdoc */ @Override public Void readKey(Cursor cursor, int offset) { return null; } /** @inheritdoc */ @Override public Alarms readEntity(Cursor cursor, int offset) { Alarms entity = new Alarms( // cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // alarmContent cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // alarmId cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // alarmLevelNo cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // alarmLevelNoDesc cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // alarmType cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // alarmTypeDesc cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // publishTime cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // areaid cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // areaName ); return entity; } /** @inheritdoc */ @Override public void readEntity(Cursor cursor, Alarms entity, int offset) { entity.setAlarmContent(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0)); entity.setAlarmId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setAlarmLevelNo(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setAlarmLevelNoDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setAlarmType(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setAlarmTypeDesc(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); entity.setPublishTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setAreaid(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setAreaName(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); } /** @inheritdoc */ @Override protected Void updateKeyAfterInsert(Alarms entity, long rowId) { // Unsupported or missing PK type return null; } /** @inheritdoc */ @Override public Void getKey(Alarms entity) { return null; } /** @inheritdoc */ @Override protected boolean isEntityUpdateable() { return true; } }