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


import java.util.Arrays;
import java.util.Collection;
import java.util.List;

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;

import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.ErvuDashboard;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.Keys;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.records.RecruitErvuStatusRecord;


/**
 * Справочник статусов ЕРВУ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RecruitErvuStatus extends TableImpl<RecruitErvuStatusRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.recruit_ervu_status</code>
     */
    public static final RecruitErvuStatus RECRUIT_ERVU_STATUS = new RecruitErvuStatus();

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

    /**
     * The column
     * <code>ervu_dashboard.recruit_ervu_status.recruit_ervu_status_id</code>.
     */
    public final TableField<RecruitErvuStatusRecord, Long> RECRUIT_ERVU_STATUS_ID = createField(DSL.name("recruit_ervu_status_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ervu_dashboard.recruit_ervu_status.code</code>.
     * Cправочный код статуса
     */
    public final TableField<RecruitErvuStatusRecord, String> CODE = createField(DSL.name("code"), SQLDataType.VARCHAR(15).nullable(false), this, "Cправочный код статуса");

    /**
     * The column <code>ervu_dashboard.recruit_ervu_status.value</code>.
     * Значение статуса
     */
    public final TableField<RecruitErvuStatusRecord, String> VALUE = createField(DSL.name("value"), SQLDataType.VARCHAR(255).nullable(false), this, "Значение статуса");

    /**
     * The column <code>ervu_dashboard.recruit_ervu_status.description</code>.
     * Описание статуса
     */
    public final TableField<RecruitErvuStatusRecord, String> DESCRIPTION = createField(DSL.name("description"), SQLDataType.CLOB, this, "Описание статуса");

    /**
     * The column <code>ervu_dashboard.recruit_ervu_status.actual</code>.
     * Признак актуальности справочного значения
     */
    public final TableField<RecruitErvuStatusRecord, Boolean> ACTUAL = createField(DSL.name("actual"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "Признак актуальности справочного значения");

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

    private RecruitErvuStatus(Name alias, Table<RecruitErvuStatusRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Справочник статусов ЕРВУ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>ervu_dashboard.recruit_ervu_status</code> table
     * reference
     */
    public RecruitErvuStatus(String alias) {
        this(DSL.name(alias), RECRUIT_ERVU_STATUS);
    }

    /**
     * Create an aliased <code>ervu_dashboard.recruit_ervu_status</code> table
     * reference
     */
    public RecruitErvuStatus(Name alias) {
        this(alias, RECRUIT_ERVU_STATUS);
    }

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

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

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

    @Override
    public UniqueKey<RecruitErvuStatusRecord> getPrimaryKey() {
        return Keys.RECRUIT_ERVU_STATUS_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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