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


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

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 BWeb extends TableImpl<BWebRecord> {

    /**
     * The reference instance of <code>DB_ETERNAL.B_WEB</code>
     */
    public static final BWeb B_WEB = new BWeb();
    private static final long serialVersionUID = 1L;
    /**
     * The column <code>DB_ETERNAL.B_WEB.KEY</code>. 「key」- 主键
     */
    public final TableField<BWebRecord, String> KEY = createField(DSL.name("KEY"), SQLDataType.VARCHAR(36).nullable(false), this, "「key」- 主键");
    /**
     * The column <code>DB_ETERNAL.B_WEB.CODE</code>. 「code」- 系统内部编码
     */
    public final TableField<BWebRecord, String> CODE = createField(DSL.name("CODE"), SQLDataType.VARCHAR(255), this, "「code」- 系统内部编码");
    /**
     * The column <code>DB_ETERNAL.B_WEB.BLOCK_ID</code>. 「blockId」- 所属模块ID
     */
    public final TableField<BWebRecord, String> BLOCK_ID = createField(DSL.name("BLOCK_ID"), SQLDataType.VARCHAR(36), this, "「blockId」- 所属模块ID");
    /**
     * The column <code>DB_ETERNAL.B_WEB.TYPE</code>. 「type」- 类型保留，单独区分
     */
    public final TableField<BWebRecord, String> TYPE = createField(DSL.name("TYPE"), SQLDataType.VARCHAR(64), this, "「type」- 类型保留，单独区分");
    /**
     * The column <code>DB_ETERNAL.B_WEB.LIC_CONTENT</code>. 「licContent」- 内容编码
     */
    public final TableField<BWebRecord, String> LIC_CONTENT = createField(DSL.name("LIC_CONTENT"), SQLDataType.CLOB, this, "「licContent」- 内容编码");
    /**
     * The column <code>DB_ETERNAL.B_WEB.LIC_OP</code>. 「licOp」- 界面操作
     */
    public final TableField<BWebRecord, String> LIC_OP = createField(DSL.name("LIC_OP"), SQLDataType.CLOB, this, "「licOp」- 界面操作");
    /**
     * The column <code>DB_ETERNAL.B_WEB.LIC_MODULE</code>. 「licModule」- 单独指定
     * X_MODULE 中的记录
     */
    public final TableField<BWebRecord, String> LIC_MODULE = createField(DSL.name("LIC_MODULE"), SQLDataType.CLOB, this, "「licModule」- 单独指定 X_MODULE 中的记录");
    /**
     * The column <code>DB_ETERNAL.B_WEB.LIC_TPL</code>. 「licTpl」- PAGE, LAYOUT,
     * CONTROL 等记录
     */
    public final TableField<BWebRecord, String> LIC_TPL = createField(DSL.name("LIC_TPL"), SQLDataType.CLOB, this, "「licTpl」- PAGE, LAYOUT, CONTROL 等记录");
    /**
     * The column <code>DB_ETERNAL.B_WEB.ACTIVE</code>. 「active」- 是否启用
     */
    public final TableField<BWebRecord, Boolean> ACTIVE = createField(DSL.name("ACTIVE"), SQLDataType.BIT, this, "「active」- 是否启用");
    /**
     * The column <code>DB_ETERNAL.B_WEB.SIGMA</code>. 「sigma」- 统一标识
     */
    public final TableField<BWebRecord, String> SIGMA = createField(DSL.name("SIGMA"), SQLDataType.VARCHAR(32), this, "「sigma」- 统一标识");
    /**
     * The column <code>DB_ETERNAL.B_WEB.METADATA</code>. 「metadata」- 附加配置
     */
    public final TableField<BWebRecord, String> METADATA = createField(DSL.name("METADATA"), SQLDataType.CLOB, this, "「metadata」- 附加配置");
    /**
     * The column <code>DB_ETERNAL.B_WEB.LANGUAGE</code>. 「language」- 使用的语言
     */
    public final TableField<BWebRecord, String> LANGUAGE = createField(DSL.name("LANGUAGE"), SQLDataType.VARCHAR(8), this, "「language」- 使用的语言");

    private BWeb(Name alias, Table<BWebRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

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

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

    public <O extends Record> BWeb(Table<O> child, ForeignKey<O, BWebRecord> key) {
        super(child, key, B_WEB);
    }

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

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

    @Override
    public UniqueKey<BWebRecord> getPrimaryKey() {
        return Keys.KEY_B_WEB_PRIMARY;
    }

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

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

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

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

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

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

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

    // -------------------------------------------------------------------------
    // Row12 type methods
    // -------------------------------------------------------------------------

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

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
     */
    public <U> SelectField<U> mapping(Function12<? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super Boolean, ? super String, ? super String, ? 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, Function12<? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super Boolean, ? super String, ? super String, ? super String, ? extends U> from) {
        return convertFrom(toType, Records.mapping(from));
    }
}
