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


import cn.vertxup.tpl.domain.Db;
import cn.vertxup.tpl.domain.Keys;
import cn.vertxup.tpl.domain.tables.records.MyMenuRecord;
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 MyMenu extends TableImpl<MyMenuRecord> {

    /**
     * The reference instance of <code>DB_ETERNAL.MY_MENU</code>
     */
    public static final MyMenu MY_MENU = new MyMenu();
    private static final long serialVersionUID = 1L;
    /**
     * The column <code>DB_ETERNAL.MY_MENU.KEY</code>. 「key」- 菜单主键
     */
    public final TableField<MyMenuRecord, String> KEY = createField(DSL.name("KEY"), SQLDataType.VARCHAR(36).nullable(false), this, "「key」- 菜单主键");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.ICON</code>. 「icon」- 菜单使用的icon
     */
    public final TableField<MyMenuRecord, String> ICON = createField(DSL.name("ICON"), SQLDataType.VARCHAR(255), this, "「icon」- 菜单使用的icon");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.TEXT</code>. 「text」- 菜单显示文字
     */
    public final TableField<MyMenuRecord, String> TEXT = createField(DSL.name("TEXT"), SQLDataType.VARCHAR(255), this, "「text」- 菜单显示文字");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.URI</code>. 「uri」- 菜单地址（不包含应用的path）
     */
    public final TableField<MyMenuRecord, String> URI = createField(DSL.name("URI"), SQLDataType.VARCHAR(255), this, "「uri」- 菜单地址（不包含应用的path）");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.UI_SORT</code>. 「uiSort」- 菜单排序
     */
    public final TableField<MyMenuRecord, Long> UI_SORT = createField(DSL.name("UI_SORT"), SQLDataType.BIGINT, this, "「uiSort」- 菜单排序");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.UI_PARENT</code>. 「uiParent」- 菜单父ID
     */
    public final TableField<MyMenuRecord, String> UI_PARENT = createField(DSL.name("UI_PARENT"), SQLDataType.VARCHAR(36), this, "「uiParent」- 菜单父ID");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.UI_COLOR_FG</code>. 「uiColorFg」- 前景色
     */
    public final TableField<MyMenuRecord, String> UI_COLOR_FG = createField(DSL.name("UI_COLOR_FG"), SQLDataType.VARCHAR(16), this, "「uiColorFg」- 前景色");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.UI_COLOR_BG</code>. 「uiColorBg」- 背景色
     */
    public final TableField<MyMenuRecord, String> UI_COLOR_BG = createField(DSL.name("UI_COLOR_BG"), SQLDataType.VARCHAR(16), this, "「uiColorBg」- 背景色");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.TYPE</code>. 「type」- 菜单类型
     */
    public final TableField<MyMenuRecord, String> TYPE = createField(DSL.name("TYPE"), SQLDataType.VARCHAR(32), this, "「type」- 菜单类型");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.PAGE</code>. 「page」- 菜单所在页面
     */
    public final TableField<MyMenuRecord, String> PAGE = createField(DSL.name("PAGE"), SQLDataType.VARCHAR(64), this, "「page」- 菜单所在页面");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.POSITION</code>. 「position」- 菜单位置
     */
    public final TableField<MyMenuRecord, String> POSITION = createField(DSL.name("POSITION"), SQLDataType.VARCHAR(16), this, "「position」- 菜单位置");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.OWNER</code>. 「owner」- 拥有者ID，我的 / 角色级
     */
    public final TableField<MyMenuRecord, String> OWNER = createField(DSL.name("OWNER"), SQLDataType.VARCHAR(36), this, "「owner」- 拥有者ID，我的 / 角色级");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.OWNER_TYPE</code>. 「ownerType」- ROLE
     * 角色，USER 用户
     */
    public final TableField<MyMenuRecord, String> OWNER_TYPE = createField(DSL.name("OWNER_TYPE"), SQLDataType.VARCHAR(5), this, "「ownerType」- ROLE 角色，USER 用户");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.ACTIVE</code>. 「active」- 是否启用
     */
    public final TableField<MyMenuRecord, Boolean> ACTIVE = createField(DSL.name("ACTIVE"), SQLDataType.BIT, this, "「active」- 是否启用");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.SIGMA</code>. 「sigma」- 统一标识
     */
    public final TableField<MyMenuRecord, String> SIGMA = createField(DSL.name("SIGMA"), SQLDataType.VARCHAR(32), this, "「sigma」- 统一标识");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.METADATA</code>. 「metadata」- 附加配置
     */
    public final TableField<MyMenuRecord, String> METADATA = createField(DSL.name("METADATA"), SQLDataType.CLOB, this, "「metadata」- 附加配置");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.LANGUAGE</code>. 「language」- 使用的语言
     */
    public final TableField<MyMenuRecord, String> LANGUAGE = createField(DSL.name("LANGUAGE"), SQLDataType.VARCHAR(8), this, "「language」- 使用的语言");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.CREATED_AT</code>. 「createdAt」- 创建时间
     */
    public final TableField<MyMenuRecord, LocalDateTime> CREATED_AT = createField(DSL.name("CREATED_AT"), SQLDataType.LOCALDATETIME(0), this, "「createdAt」- 创建时间");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.CREATED_BY</code>. 「createdBy」- 创建人
     */
    public final TableField<MyMenuRecord, String> CREATED_BY = createField(DSL.name("CREATED_BY"), SQLDataType.VARCHAR(36), this, "「createdBy」- 创建人");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.UPDATED_AT</code>. 「updatedAt」- 更新时间
     */
    public final TableField<MyMenuRecord, LocalDateTime> UPDATED_AT = createField(DSL.name("UPDATED_AT"), SQLDataType.LOCALDATETIME(0), this, "「updatedAt」- 更新时间");
    /**
     * The column <code>DB_ETERNAL.MY_MENU.UPDATED_BY</code>. 「updatedBy」- 更新人
     */
    public final TableField<MyMenuRecord, String> UPDATED_BY = createField(DSL.name("UPDATED_BY"), SQLDataType.VARCHAR(36), this, "「updatedBy」- 更新人");

    private MyMenu(Name alias, Table<MyMenuRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

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

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

    public <O extends Record> MyMenu(Table<O> child, ForeignKey<O, MyMenuRecord> key) {
        super(child, key, MY_MENU);
    }

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

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

    @Override
    public UniqueKey<MyMenuRecord> getPrimaryKey() {
        return Keys.KEY_MY_MENU_PRIMARY;
    }

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

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

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

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

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

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

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

    // -------------------------------------------------------------------------
    // Row21 type methods
    // -------------------------------------------------------------------------

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

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
     */
    public <U> SelectField<U> mapping(Function21<? super String, ? super String, ? super String, ? super String, ? super Long, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? 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, Function21<? super String, ? super String, ? super String, ? super String, ? super Long, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? 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));
    }
}
