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


/**
 * Справочник типа образовательного учреждения
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class EducationInstitutionType extends TableImpl<EducationInstitutionTypeRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.education_institution_type</code>
     */
    public static final EducationInstitutionType EDUCATION_INSTITUTION_TYPE = new EducationInstitutionType();

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

    /**
     * The column
     * <code>ervu_dashboard.education_institution_type.education_institution_type_id</code>.
     */
    public final TableField<EducationInstitutionTypeRecord, Long> EDUCATION_INSTITUTION_TYPE_ID = createField(DSL.name("education_institution_type_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

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

    private EducationInstitutionType(Name alias, Table<EducationInstitutionTypeRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Справочник типа образовательного учреждения"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.education_institution_type</code>
     * table reference
     */
    public EducationInstitutionType(Name alias) {
        this(alias, EDUCATION_INSTITUTION_TYPE);
    }

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

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

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

    @Override
    public UniqueKey<EducationInstitutionTypeRecord> getPrimaryKey() {
        return Keys.EDUCATION_INSTITUTION_TYPE_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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