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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.education_minobr_speciality</code>
     */
    public static final EducationMinobrSpeciality EDUCATION_MINOBR_SPECIALITY = new EducationMinobrSpeciality();

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

    /**
     * The column
     * <code>ervu_dashboard.education_minobr_speciality.education_minobr_speciality_id</code>.
     */
    public final TableField<EducationMinobrSpecialityRecord, Long> EDUCATION_MINOBR_SPECIALITY_ID = createField(DSL.name("education_minobr_speciality_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

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

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

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

    /**
     * Create an aliased <code>ervu_dashboard.education_minobr_speciality</code>
     * table reference
     */
    public EducationMinobrSpeciality(Name alias) {
        this(alias, EDUCATION_MINOBR_SPECIALITY);
    }

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

    public <O extends Record> EducationMinobrSpeciality(Table<O> path, ForeignKey<O, EducationMinobrSpecialityRecord> childPath, InverseForeignKey<O, EducationMinobrSpecialityRecord> parentPath) {
        super(path, childPath, parentPath, EDUCATION_MINOBR_SPECIALITY);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<EducationMinobrSpecialityRecord> getPrimaryKey() {
        return Keys.EDUCATION_MINOBR_SPECIALITY_PKEY;
    }

    @Override
    public List<UniqueKey<EducationMinobrSpecialityRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.EDUCATION_MINOBR_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_MINOBR_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_FOREIGN_EDUCATION_DIPLOMA_EDUCATION_MINOBR_SPECIALITY_C.getInverseKey());

        return _citizenForeignEducationDiploma;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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