/*
 * 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.ForeignKey;
import org.jooq.Identity;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Path;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.Record;
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.CitizenEducationDiploma.CitizenEducationDiplomaPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.CitizenForeignEducationDiploma.CitizenForeignEducationDiplomaPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.records.EducationMinprosvSpecialityRecord;


/**
 * Справочник специальности минпросвещения
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class EducationMinprosvSpeciality extends TableImpl<EducationMinprosvSpecialityRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.education_minprosv_speciality</code>
     */
    public static final EducationMinprosvSpeciality EDUCATION_MINPROSV_SPECIALITY = new EducationMinprosvSpeciality();

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

    /**
     * The column
     * <code>ervu_dashboard.education_minprosv_speciality.education_minprosv_speciality_id</code>.
     */
    public final TableField<EducationMinprosvSpecialityRecord, Long> EDUCATION_MINPROSV_SPECIALITY_ID = createField(DSL.name("education_minprosv_speciality_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

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

    private EducationMinprosvSpeciality(Name alias, Table<EducationMinprosvSpecialityRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Справочник специальности минпросвещения"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased
     * <code>ervu_dashboard.education_minprosv_speciality</code> table reference
     */
    public EducationMinprosvSpeciality(Name alias) {
        this(alias, EDUCATION_MINPROSV_SPECIALITY);
    }

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

    public <O extends Record> EducationMinprosvSpeciality(Table<O> path, ForeignKey<O, EducationMinprosvSpecialityRecord> childPath, InverseForeignKey<O, EducationMinprosvSpecialityRecord> parentPath) {
        super(path, childPath, parentPath, EDUCATION_MINPROSV_SPECIALITY);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class EducationMinprosvSpecialityPath extends EducationMinprosvSpeciality implements Path<EducationMinprosvSpecialityRecord> {
        public <O extends Record> EducationMinprosvSpecialityPath(Table<O> path, ForeignKey<O, EducationMinprosvSpecialityRecord> childPath, InverseForeignKey<O, EducationMinprosvSpecialityRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private EducationMinprosvSpecialityPath(Name alias, Table<EducationMinprosvSpecialityRecord> aliased) {
            super(alias, aliased);
        }

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

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

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

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

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

    @Override
    public UniqueKey<EducationMinprosvSpecialityRecord> getPrimaryKey() {
        return Keys.EDUCATION_MINPROSV_SPECIALITY_PKEY;
    }

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

    private transient CitizenEducationDiplomaPath _citizenEducationDiploma;

    /**
     * Get the implicit to-many join path to the
     * <code>ervu_dashboard.citizen_education_diploma</code> table
     */
    public CitizenEducationDiplomaPath citizenEducationDiploma() {
        if (_citizenEducationDiploma == null)
            _citizenEducationDiploma = new CitizenEducationDiplomaPath(this, null, Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINPROSV_SPECIALITY_CODE_FK.getInverseKey());

        return _citizenEducationDiploma;
    }

    private transient CitizenForeignEducationDiplomaPath _citizenForeignEducationDiploma;

    /**
     * Get the implicit to-many join path to the
     * <code>ervu_dashboard.citizen_foreign_education_diploma</code> table
     */
    public CitizenForeignEducationDiplomaPath citizenForeignEducationDiploma() {
        if (_citizenForeignEducationDiploma == null)
            _citizenForeignEducationDiploma = new CitizenForeignEducationDiplomaPath(this, null, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINPROSV_SPECIALITY_CODE_FK.getInverseKey());

        return _citizenForeignEducationDiploma;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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