/*
 * This file is generated by jOOQ.
 */
package cn.vertxup.ambient.domain.tables;


import cn.vertxup.ambient.domain.Db;
import cn.vertxup.ambient.domain.Keys;
import cn.vertxup.ambient.domain.tables.records.XTagRecord;
import org.jooq.Record;
import org.jooq.*;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({"all", "unchecked", "rawtypes"})
public class XTag extends TableImpl<XTagRecord> {

    /**
     * The reference instance of <code>DB_ETERNAL.X_TAG</code>
     */
    public static final XTag X_TAG = new XTag();
    private static final long serialVersionUID = 1L;
    /**
     * The column <code>DB_ETERNAL.X_TAG.KEY</code>. 「key」- 标签主键
     */
    public final TableField<XTagRecord, String> KEY = createField(DSL.name("KEY"), SQLDataType.VARCHAR(36).nullable(false), this, "「key」- 标签主键");
    /**
     * The column <code>DB_ETERNAL.X_TAG.NAME</code>. 「name」- 标签名称
     */
    public final TableField<XTagRecord, String> NAME = createField(DSL.name("NAME"), SQLDataType.VARCHAR(255).nullable(false), this, "「name」- 标签名称");
    /**
     * The column <code>DB_ETERNAL.X_TAG.TYPE</code>. 「type」- 标签类型
     */
    public final TableField<XTagRecord, String> TYPE = createField(DSL.name("TYPE"), SQLDataType.VARCHAR(255), this, "「type」- 标签类型");
    /**
     * The column <code>DB_ETERNAL.X_TAG.ICON</code>. 「icon」- 标签使用的图标
     */
    public final TableField<XTagRecord, String> ICON = createField(DSL.name("ICON"), SQLDataType.VARCHAR(255), this, "「icon」- 标签使用的图标");
    /**
     * The column <code>DB_ETERNAL.X_TAG.SORT</code>. 「sort」- 标签排序
     */
    public final TableField<XTagRecord, Long> SORT = createField(DSL.name("SORT"), SQLDataType.BIGINT, this, "「sort」- 标签排序");
    /**
     * The column <code>DB_ETERNAL.X_TAG.SHOW</code>. 「show」- 是否显示在导航栏
     */
    public final TableField<XTagRecord, Boolean> SHOW = createField(DSL.name("SHOW"), SQLDataType.BIT.defaultValue(DSL.inline("b'0'", SQLDataType.BIT)), this, "「show」- 是否显示在导航栏");
    /**
     * The column <code>DB_ETERNAL.X_TAG.DESCRIPTION</code>. 「description」- 标签描述
     */
    public final TableField<XTagRecord, String> DESCRIPTION = createField(DSL.name("DESCRIPTION"), SQLDataType.CLOB, this, "「description」- 标签描述");
    /**
     * The column <code>DB_ETERNAL.X_TAG.APP_ID</code>. 「appId」- 关联的应用程序ID
     */
    public final TableField<XTagRecord, String> APP_ID = createField(DSL.name("APP_ID"), SQLDataType.VARCHAR(255), this, "「appId」- 关联的应用程序ID");
    /**
     * The column <code>DB_ETERNAL.X_TAG.ACTIVE</code>. 「active」- 是否启用
     */
    public final TableField<XTagRecord, Boolean> ACTIVE = createField(DSL.name("ACTIVE"), SQLDataType.BIT, this, "「active」- 是否启用");
    /**
     * The column <code>DB_ETERNAL.X_TAG.SIGMA</code>. 「sigma」- 统一标识
     */
    public final TableField<XTagRecord, String> SIGMA = createField(DSL.name("SIGMA"), SQLDataType.VARCHAR(32), this, "「sigma」- 统一标识");
    /**
     * The column <code>DB_ETERNAL.X_TAG.METADATA</code>. 「metadata」- 附加配置
     */
    public final TableField<XTagRecord, String> METADATA = createField(DSL.name("METADATA"), SQLDataType.CLOB, this, "「metadata」- 附加配置");
    /**
     * The column <code>DB_ETERNAL.X_TAG.LANGUAGE</code>. 「language」- 使用的语言
     */
    public final TableField<XTagRecord, String> LANGUAGE = createField(DSL.name("LANGUAGE"), SQLDataType.VARCHAR(8), this, "「language」- 使用的语言");
    /**
     * The column <code>DB_ETERNAL.X_TAG.CREATED_AT</code>. 「createdAt」- 创建时间
     */
    public final TableField<XTagRecord, LocalDateTime> CREATED_AT = createField(DSL.name("CREATED_AT"), SQLDataType.LOCALDATETIME(0), this, "「createdAt」- 创建时间");
    /**
     * The column <code>DB_ETERNAL.X_TAG.CREATED_BY</code>. 「createdBy」- 创建人
     */
    public final TableField<XTagRecord, String> CREATED_BY = createField(DSL.name("CREATED_BY"), SQLDataType.VARCHAR(36), this, "「createdBy」- 创建人");
    /**
     * The column <code>DB_ETERNAL.X_TAG.UPDATED_AT</code>. 「updatedAt」- 更新时间
     */
    public final TableField<XTagRecord, LocalDateTime> UPDATED_AT = createField(DSL.name("UPDATED_AT"), SQLDataType.LOCALDATETIME(0), this, "「updatedAt」- 更新时间");
    /**
     * The column <code>DB_ETERNAL.X_TAG.UPDATED_BY</code>. 「updatedBy」- 更新人
     */
    public final TableField<XTagRecord, String> UPDATED_BY = createField(DSL.name("UPDATED_BY"), SQLDataType.VARCHAR(36), this, "「updatedBy」- 更新人");

    private XTag(Name alias, Table<XTagRecord> aliased) {
        this(alias, aliased, null);
    }

    private XTag(Name alias, Table<XTagRecord> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
    }

    /**
     * Create an aliased <code>DB_ETERNAL.X_TAG</code> table reference
     */
    public XTag(String alias) {
        this(DSL.name(alias), X_TAG);
    }

    /**
     * Create an aliased <code>DB_ETERNAL.X_TAG</code> table reference
     */
    public XTag(Name alias) {
        this(alias, X_TAG);
    }

    /**
     * Create a <code>DB_ETERNAL.X_TAG</code> table reference
     */
    public XTag() {
        this(DSL.name("X_TAG"), null);
    }

    public <O extends Record> XTag(Table<O> child, ForeignKey<O, XTagRecord> key) {
        super(child, key, X_TAG);
    }

    /**
     * The class holding records for this type
     */
    @Override
    public Class<XTagRecord> getRecordType() {
        return XTagRecord.class;
    }

    @Override
    public Schema getSchema() {
        return aliased() ? null : Db.DB_ETERNAL;
    }

    @Override
    public UniqueKey<XTagRecord> getPrimaryKey() {
        return Keys.KEY_X_TAG_PRIMARY;
    }

    @Override
    public List<UniqueKey<XTagRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.KEY_X_TAG_NAME);
    }

    @Override
    public XTag as(String alias) {
        return new XTag(DSL.name(alias), this);
    }

    @Override
    public XTag as(Name alias) {
        return new XTag(alias, this);
    }

    @Override
    public XTag as(Table<?> alias) {
        return new XTag(alias.getQualifiedName(), this);
    }

    /**
     * Rename this table
     */
    @Override
    public XTag rename(String name) {
        return new XTag(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public XTag rename(Name name) {
        return new XTag(name, null);
    }

    /**
     * Rename this table
     */
    @Override
    public XTag rename(Table<?> name) {
        return new XTag(name.getQualifiedName(), null);
    }

    // -------------------------------------------------------------------------
    // Row16 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row16<String, String, String, String, Long, Boolean, String, String, Boolean, String, String, String, LocalDateTime, String, LocalDateTime, String> fieldsRow() {
        return (Row16) super.fieldsRow();
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
     */
    public <U> SelectField<U> mapping(Function16<? super String, ? super String, ? super String, ? super String, ? super Long, ? super Boolean, ? super String, ? super String, ? super Boolean, ? super String, ? super String, ? super String, ? super LocalDateTime, ? super String, ? super LocalDateTime, ? super String, ? extends U> from) {
        return convertFrom(Records.mapping(from));
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Class,
     * Function)}.
     */
    public <U> SelectField<U> mapping(Class<U> toType, Function16<? super String, ? super String, ? super String, ? super String, ? super Long, ? super Boolean, ? super String, ? super String, ? super Boolean, ? super String, ? super String, ? super String, ? super LocalDateTime, ? super String, ? super LocalDateTime, ? super String, ? extends U> from) {
        return convertFrom(toType, Records.mapping(from));
    }
}
