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