/*
 * This file is generated by jOOQ.
 */
package jj.tech.paolu.repository.jooq.tables;


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

import jj.tech.paolu.repository.jooq.Keys;
import jj.tech.paolu.repository.jooq.Yx;
import jj.tech.paolu.repository.jooq.tables.records.SysAdminMenuRecord;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Function3;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Records;
import org.jooq.Row3;
import org.jooq.Schema;
import org.jooq.SelectField;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
public class SysAdminMenu extends TableImpl<SysAdminMenuRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>yx.sys_admin_menu</code>
     */
    public static final SysAdminMenu SYS_ADMIN_MENU = new SysAdminMenu();

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

    /**
     * The column <code>yx.sys_admin_menu.id</code>.
     */
    public final TableField<SysAdminMenuRecord, String> ID = createField(DSL.name("id"), SQLDataType.VARCHAR(20).nullable(false), this, "");

    /**
     * The column <code>yx.sys_admin_menu.adminid</code>.
     */
    public final TableField<SysAdminMenuRecord, String> ADMINID = createField(DSL.name("adminid"), SQLDataType.VARCHAR(20).nullable(false), this, "");

    /**
     * The column <code>yx.sys_admin_menu.memuid</code>.
     */
    public final TableField<SysAdminMenuRecord, String> MEMUID = createField(DSL.name("memuid"), SQLDataType.VARCHAR(20).nullable(false), this, "");

    private SysAdminMenu(Name alias, Table<SysAdminMenuRecord> aliased) {
        this(alias, aliased, null);
    }

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

    /**
     * Create an aliased <code>yx.sys_admin_menu</code> table reference
     */
    public SysAdminMenu(String alias) {
        this(DSL.name(alias), SYS_ADMIN_MENU);
    }

    /**
     * Create an aliased <code>yx.sys_admin_menu</code> table reference
     */
    public SysAdminMenu(Name alias) {
        this(alias, SYS_ADMIN_MENU);
    }

    /**
     * Create a <code>yx.sys_admin_menu</code> table reference
     */
    public SysAdminMenu() {
        this(DSL.name("sys_admin_menu"), null);
    }

    public <O extends Record> SysAdminMenu(Table<O> child, ForeignKey<O, SysAdminMenuRecord> key) {
        super(child, key, SYS_ADMIN_MENU);
    }

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

    @Override
    public UniqueKey<SysAdminMenuRecord> getPrimaryKey() {
        return Keys.KEY_SYS_ADMIN_MENU_PRIMARY;
    }

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

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

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

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

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

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

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

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

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

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