class SqlTableColumnView {
    /** Table. */
    private final TableDescriptor tbl;

    /** Query property. */
    private final GridQueryProperty prop;

    /**
     * @param tbl Table.
     * @param prop Column.
     */
    public SqlTableColumnView(TableDescriptor tbl, GridQueryProperty prop) {
        this.tbl = tbl;
        this.prop = prop;
    }

    /** @return Column name. */
    @Order
    public String columnName() {
        return prop.name();
    }

    /** @return Schema name. */
    @Order(2)
    public String schemaName() {
        return tbl.type().schemaName();
    }

    /** @return Table name. */
    @Order(1)
    public String tableName() {
        return tbl.type().tableName();
    }

    /** @return Field data type. */
    public Class<?> type() {
        return prop.type();
    }

    /** @return Field default. */
    public String defaultValue() {
        return prop.defaultValue() == null ? null : prop.defaultValue().toString();
    }

    /** @return Precision. */
    public int precision() {
        return prop.precision();
    }

    /** @return Scale. */
    public int scale() {
        return prop.scale();
    }

    /** @return {@code True} if nullable field. */
    public boolean nullable() {
        return !prop.notNull();
    }

    /** @return {@code True} if primary key. */
    public boolean pk() {
        return F.eq(prop.name(), tbl.type().keyFieldName()) || prop.key();
    }

    /** @return {@code True} if autoincremented field. */
    public boolean autoIncrement() {
        return false;
    }

    /** @return {@code True} if affinity column. */
    public boolean affinityColumn() {<FILL_FUNCTION_BODY>}
}

        return !tbl.type().customAffinityKeyMapper() &&
            (F.eq(prop.name(), tbl.type().affinityKey()) || (F.isEmpty(tbl.type().affinityKey()) && pk()));
    
<no_super_class>