/*
 * This file is generated by jOOQ.
 */
package ervu_dashboard.ervu_dashboard.db_beans.public_.tables;


import ervu_dashboard.ervu_dashboard.db_beans.public_.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.public_.Public;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.records.SubpoenaRecord;

import java.sql.Timestamp;
import java.util.Collection;
import java.util.UUID;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.SQL;
import org.jooq.Schema;
import org.jooq.Select;
import org.jooq.Stringly;
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" })
public class Subpoena extends TableImpl<SubpoenaRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.subpoena</code>
     */
    public static final Subpoena SUBPOENA = new Subpoena();

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

    /**
     * The column <code>public.subpoena.subpoena_id</code>.
     */
    public final TableField<SubpoenaRecord, Long> SUBPOENA_ID = createField(DSL.name("subpoena_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>public.subpoena.series</code>.
     */
    public final TableField<SubpoenaRecord, String> SERIES = createField(DSL.name("series"), SQLDataType.VARCHAR(16), this, "");

    /**
     * The column <code>public.subpoena.number</code>.
     */
    public final TableField<SubpoenaRecord, String> NUMBER = createField(DSL.name("number"), SQLDataType.VARCHAR(36).nullable(false), this, "");

    /**
     * The column <code>public.subpoena.id_ern</code>.
     */
    public final TableField<SubpoenaRecord, String> ID_ERN = createField(DSL.name("id_ern"), SQLDataType.VARCHAR(36), this, "");

    /**
     * The column <code>public.subpoena.create_date</code>.
     */
    public final TableField<SubpoenaRecord, Timestamp> CREATE_DATE = createField(DSL.name("create_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");

    /**
     * The column <code>public.subpoena.visit_date</code>.
     */
    public final TableField<SubpoenaRecord, Timestamp> VISIT_DATE = createField(DSL.name("visit_date"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>public.subpoena.send_date</code>.
     */
    public final TableField<SubpoenaRecord, Timestamp> SEND_DATE = createField(DSL.name("send_date"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>public.subpoena.reason_cancelled</code>.
     */
    public final TableField<SubpoenaRecord, String> REASON_CANCELLED = createField(DSL.name("reason_cancelled"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>public.subpoena.recruit_id</code>.
     */
    public final TableField<SubpoenaRecord, UUID> RECRUIT_ID = createField(DSL.name("recruit_id"), SQLDataType.UUID, this, "");

    /**
     * The column <code>public.subpoena.department_id</code>.
     */
    public final TableField<SubpoenaRecord, UUID> DEPARTMENT_ID = createField(DSL.name("department_id"), SQLDataType.UUID, this, "");

    /**
     * The column <code>public.subpoena.subpoena_status</code>.
     */
    public final TableField<SubpoenaRecord, String> SUBPOENA_STATUS = createField(DSL.name("subpoena_status"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>public.subpoena.subpoena_reason</code>.
     */
    public final TableField<SubpoenaRecord, String> SUBPOENA_REASON = createField(DSL.name("subpoena_reason"), SQLDataType.CLOB, this, "");

    private Subpoena(Name alias, Table<SubpoenaRecord> aliased) {
        this(alias, aliased, (Field<?>[]) null, null);
    }

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

    /**
     * Create an aliased <code>public.subpoena</code> table reference
     */
    public Subpoena(String alias) {
        this(DSL.name(alias), SUBPOENA);
    }

    /**
     * Create an aliased <code>public.subpoena</code> table reference
     */
    public Subpoena(Name alias) {
        this(alias, SUBPOENA);
    }

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

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

    @Override
    public Identity<SubpoenaRecord, Long> getIdentity() {
        return (Identity<SubpoenaRecord, Long>) super.getIdentity();
    }

    @Override
    public UniqueKey<SubpoenaRecord> getPrimaryKey() {
        return Keys.SUBPOENA_PKEY;
    }

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

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

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

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

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

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

    /**
     * Create an inline derived table from this table
     */
    @Override
    public Subpoena where(Condition condition) {
        return new Subpoena(getQualifiedName(), aliased() ? this : null, null, condition);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public Subpoena where(Collection<? extends Condition> conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public Subpoena where(Condition... conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public Subpoena where(Field<Boolean> condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public Subpoena where(SQL condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public Subpoena where(@Stringly.SQL String condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public Subpoena where(@Stringly.SQL String condition, Object... binds) {
        return where(DSL.condition(condition, binds));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public Subpoena where(@Stringly.SQL String condition, QueryPart... parts) {
        return where(DSL.condition(condition, parts));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public Subpoena whereExists(Select<?> select) {
        return where(DSL.exists(select));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public Subpoena whereNotExists(Select<?> select) {
        return where(DSL.notExists(select));
    }
}
