/** @inheritdoc */ @Override public Long getKey(PasswordType entity) { if (entity != null) { return entity.getId(); } else { return null; } }
/** @inheritdoc */ @Override public void readEntity(Cursor cursor, PasswordType entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setIcon(cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1)); entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setStatus(cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3)); entity.setRemark(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setTheme(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5)); entity.setExcludeFromQuery(cursor.isNull(offset + 6) ? null : cursor.getShort(offset + 6) != 0); }
/** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, PasswordType entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } Integer icon = entity.getIcon(); if (icon != null) { stmt.bindLong(2, icon); } String name = entity.getName(); if (name != null) { stmt.bindString(3, name); } Integer status = entity.getStatus(); if (status != null) { stmt.bindLong(4, status); } String remark = entity.getRemark(); if (remark != null) { stmt.bindString(5, remark); } Integer theme = entity.getTheme(); if (theme != null) { stmt.bindLong(6, theme); } Boolean excludeFromQuery = entity.getExcludeFromQuery(); if (excludeFromQuery != null) { stmt.bindLong(7, excludeFromQuery ? 1L : 0L); } }
/** @inheritdoc */ @Override protected Long updateKeyAfterInsert(PasswordType entity, long rowId) { entity.setId(rowId); return rowId; }