/** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, Channel entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } stmt.bindString(2, entity.getTitle()); stmt.bindString(3, entity.getURL()); }
/** @inheritdoc */ @Override public Long getKey(Channel entity) { if (entity != null) { return entity.getId(); } else { return null; } }
/** @inheritdoc */ @Override protected Long updateKeyAfterInsert(Channel entity, long rowId) { entity.setId(rowId); return rowId; }
/** @inheritdoc */ @Override public void readEntity(Cursor cursor, Channel entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setTitle(cursor.getString(offset + 1)); entity.setURL(cursor.getString(offset + 2)); }