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


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


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

    /**
     * The reference instance of <code>DB_ETERNAL.T_OA_TRAINING</code>
     */
    public static final TOaTraining T_OA_TRAINING = new TOaTraining();
    private static final long serialVersionUID = 1L;
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.KEY</code>. 「key」- Ticket
     * Primary Key
     */
    public final TableField<TOaTrainingRecord, String> KEY = createField(DSL.name("KEY"), SQLDataType.VARCHAR(36).nullable(false), this, "「key」- Ticket Primary Key");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.COMMENT_EXTENSION</code>.
     * 「commentExtension」- Extension Comment
     */
    public final TableField<TOaTrainingRecord, String> COMMENT_EXTENSION = createField(DSL.name("COMMENT_EXTENSION"), SQLDataType.CLOB, this, "「commentExtension」- Extension Comment");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.START_AT</code>. 「startAt」-
     * From
     */
    public final TableField<TOaTrainingRecord, LocalDateTime> START_AT = createField(DSL.name("START_AT"), SQLDataType.LOCALDATETIME(0), this, "「startAt」- From");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.END_AT</code>. 「endAt」- To
     */
    public final TableField<TOaTrainingRecord, LocalDateTime> END_AT = createField(DSL.name("END_AT"), SQLDataType.LOCALDATETIME(0), this, "「endAt」- To");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.TRAIN_LOCATION</code>.
     * 「trainLocation」- The location for training
     */
    public final TableField<TOaTrainingRecord, String> TRAIN_LOCATION = createField(DSL.name("TRAIN_LOCATION"), SQLDataType.CLOB, this, "「trainLocation」- The location for training");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.TRAIN_MODE</code>. 「trainMode」-
     * The mode of training
     */
    public final TableField<TOaTrainingRecord, String> TRAIN_MODE = createField(DSL.name("TRAIN_MODE"), SQLDataType.VARCHAR(64), this, "「trainMode」- The mode of training");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.LEADER</code>. 「leader」- The
     * training leader
     */
    public final TableField<TOaTrainingRecord, String> LEADER = createField(DSL.name("LEADER"), SQLDataType.VARCHAR(36), this, "「leader」- The training leader");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.LEADER_COMMENT</code>.
     * 「leaderComment」- Comment from leader
     */
    public final TableField<TOaTrainingRecord, String> LEADER_COMMENT = createField(DSL.name("LEADER_COMMENT"), SQLDataType.CLOB, this, "「leaderComment」- Comment from leader");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.REVIEWER</code>. 「reviewer」-
     * The training reviewer
     */
    public final TableField<TOaTrainingRecord, String> REVIEWER = createField(DSL.name("REVIEWER"), SQLDataType.VARCHAR(36), this, "「reviewer」- The training reviewer");
    /**
     * The column <code>DB_ETERNAL.T_OA_TRAINING.REVIEWER_COMMENT</code>.
     * 「reviewerComment」- Comment from reviewer
     */
    public final TableField<TOaTrainingRecord, String> REVIEWER_COMMENT = createField(DSL.name("REVIEWER_COMMENT"), SQLDataType.CLOB, this, "「reviewerComment」- Comment from reviewer");

    private TOaTraining(Name alias, Table<TOaTrainingRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

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

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

    public <O extends Record> TOaTraining(Table<O> child, ForeignKey<O, TOaTrainingRecord> key) {
        super(child, key, T_OA_TRAINING);
    }

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

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

    @Override
    public UniqueKey<TOaTrainingRecord> getPrimaryKey() {
        return Keys.KEY_T_OA_TRAINING_PRIMARY;
    }

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

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

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

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

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

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

    // -------------------------------------------------------------------------
    // Row10 type methods
    // -------------------------------------------------------------------------

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

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