/*
 * 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.EducationStatusRecord;


/**
 * Справочник статуса обучения
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class EducationStatus extends TableImpl<EducationStatusRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.education_status</code>
     */
    public static final EducationStatus EDUCATION_STATUS = new EducationStatus();

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

    /**
     * The column
     * <code>ervu_dashboard.education_status.education_status_id</code>.
     */
    public final TableField<EducationStatusRecord, Long> EDUCATION_STATUS_ID = createField(DSL.name("education_status_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

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

    private EducationStatus(Name alias, Table<EducationStatusRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Справочник статуса обучения"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.education_status</code> table
     * reference
     */
    public EducationStatus(Name alias) {
        this(alias, EDUCATION_STATUS);
    }

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

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

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

    @Override
    public UniqueKey<EducationStatusRecord> getPrimaryKey() {
        return Keys.EDUCATION_STATUS_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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