/*
 * 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.TOaVacationRecord;
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 TOaVacation extends TableImpl<TOaVacationRecord> {

    /**
     * The reference instance of <code>DB_ETERNAL.T_OA_VACATION</code>
     */
    public static final TOaVacation T_OA_VACATION = new TOaVacation();
    private static final long serialVersionUID = 1L;
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.KEY</code>. 「key」- Ticket
     * Primary Key
     */
    public final TableField<TOaVacationRecord, String> KEY = createField(DSL.name("KEY"), SQLDataType.VARCHAR(36).nullable(false), this, "「key」- Ticket Primary Key");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.COMMENT_EXTENSION</code>.
     * 「commentExtension」- Extension Comment
     */
    public final TableField<TOaVacationRecord, String> COMMENT_EXTENSION = createField(DSL.name("COMMENT_EXTENSION"), SQLDataType.CLOB, this, "「commentExtension」- Extension Comment");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.REQUEST_BY</code>. 「requestBy」-
     * Request User
     */
    public final TableField<TOaVacationRecord, String> REQUEST_BY = createField(DSL.name("REQUEST_BY"), SQLDataType.VARCHAR(36), this, "「requestBy」- Request User");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.CLASSIFICATION</code>.
     * 「classification」- The ticket related business type
     */
    public final TableField<TOaVacationRecord, String> CLASSIFICATION = createField(DSL.name("CLASSIFICATION"), SQLDataType.VARCHAR(64), this, "「classification」- The ticket related business type");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.START_AT</code>. 「startAt」-
     * From
     */
    public final TableField<TOaVacationRecord, LocalDateTime> START_AT = createField(DSL.name("START_AT"), SQLDataType.LOCALDATETIME(0), this, "「startAt」- From");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.END_AT</code>. 「endAt」- To
     */
    public final TableField<TOaVacationRecord, LocalDateTime> END_AT = createField(DSL.name("END_AT"), SQLDataType.LOCALDATETIME(0), this, "「endAt」- To");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.DAYS</code>. 「days」- Duration
     */
    public final TableField<TOaVacationRecord, Integer> DAYS = createField(DSL.name("DAYS"), SQLDataType.INTEGER, this, "「days」- Duration");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.REASON</code>. 「reason」- The
     * reason to be done
     */
    public final TableField<TOaVacationRecord, String> REASON = createField(DSL.name("REASON"), SQLDataType.CLOB, this, "「reason」- The reason to be done");
    /**
     * The column <code>DB_ETERNAL.T_OA_VACATION.WORK_CONTENT</code>.
     * 「workContent」- Working Assignment Content
     */
    public final TableField<TOaVacationRecord, String> WORK_CONTENT = createField(DSL.name("WORK_CONTENT"), SQLDataType.CLOB, this, "「workContent」- Working Assignment Content");

    private TOaVacation(Name alias, Table<TOaVacationRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

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

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

    public <O extends Record> TOaVacation(Table<O> child, ForeignKey<O, TOaVacationRecord> key) {
        super(child, key, T_OA_VACATION);
    }

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

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

    @Override
    public UniqueKey<TOaVacationRecord> getPrimaryKey() {
        return Keys.KEY_T_OA_VACATION_PRIMARY;
    }

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

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

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

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

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

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

    // -------------------------------------------------------------------------
    // Row9 type methods
    // -------------------------------------------------------------------------

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

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