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