/** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, Place entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String label = entity.getLabel(); if (label != null) { stmt.bindString(2, label); } String name = entity.getName(); if (name != null) { stmt.bindString(3, name); } String pinyin = entity.getPinyin(); if (pinyin != null) { stmt.bindString(4, pinyin); } String province = entity.getProvince(); if (province != null) { stmt.bindString(5, province); } }
/** @inheritdoc */ @Override public void readEntity(Cursor cursor, Place entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setLabel(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setPinyin(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setProvince(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); }
/** @inheritdoc */ @Override public Long getKey(Place entity) { if (entity != null) { return entity.getId(); } else { return null; } }
/** @inheritdoc */ @Override protected Long updateKeyAfterInsert(Place entity, long rowId) { entity.setId(rowId); return rowId; }