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


import cn.vertxup.rbac.domain.Db;
import cn.vertxup.rbac.domain.Keys;
import cn.vertxup.rbac.domain.tables.records.RGroupRoleRecord;
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.function.Function;


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

    /**
     * The reference instance of <code>DB_ETERNAL.R_GROUP_ROLE</code>
     */
    public static final RGroupRole R_GROUP_ROLE = new RGroupRole();
    private static final long serialVersionUID = 1L;
    /**
     * The column <code>DB_ETERNAL.R_GROUP_ROLE.GROUP_ID</code>. 「groupId」-
     * 关联组ID
     */
    public final TableField<RGroupRoleRecord, String> GROUP_ID = createField(DSL.name("GROUP_ID"), SQLDataType.VARCHAR(36).nullable(false), this, "「groupId」- 关联组ID");
    /**
     * The column <code>DB_ETERNAL.R_GROUP_ROLE.ROLE_ID</code>. 「roleId」- 关联角色ID
     */
    public final TableField<RGroupRoleRecord, String> ROLE_ID = createField(DSL.name("ROLE_ID"), SQLDataType.VARCHAR(36).nullable(false), this, "「roleId」- 关联角色ID");
    /**
     * The column <code>DB_ETERNAL.R_GROUP_ROLE.PRIORITY</code>. 「priority」-
     * 角色优先级
     */
    public final TableField<RGroupRoleRecord, Integer> PRIORITY = createField(DSL.name("PRIORITY"), SQLDataType.INTEGER, this, "「priority」- 角色优先级");

    private RGroupRole(Name alias, Table<RGroupRoleRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

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

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

    public <O extends Record> RGroupRole(Table<O> child, ForeignKey<O, RGroupRoleRecord> key) {
        super(child, key, R_GROUP_ROLE);
    }

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

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

    @Override
    public UniqueKey<RGroupRoleRecord> getPrimaryKey() {
        return Keys.KEY_R_GROUP_ROLE_PRIMARY;
    }

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

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

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

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

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

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

    // -------------------------------------------------------------------------
    // Row3 type methods
    // -------------------------------------------------------------------------

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

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

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