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


import java.sql.Date;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.UUID;

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.CountryOksm.CountryOksmPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.EducationLevel.EducationLevelPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.EducationMinobrSpeciality.EducationMinobrSpecialityPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.EducationMinprosvSpeciality.EducationMinprosvSpecialityPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.records.CitizenForeignEducationDiplomaRecord;


/**
 * Иностранный диплом/аттестат гражданина
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CitizenForeignEducationDiploma extends TableImpl<CitizenForeignEducationDiplomaRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.citizen_foreign_education_diploma</code>
     */
    public static final CitizenForeignEducationDiploma CITIZEN_FOREIGN_EDUCATION_DIPLOMA = new CitizenForeignEducationDiploma();

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.citizen_foreign_education_diploma_id</code>.
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, Long> CITIZEN_FOREIGN_EDUCATION_DIPLOMA_ID = createField(DSL.name("citizen_foreign_education_diploma_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.education_speciality_code</code>.
     * Код специальности
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> EDUCATION_SPECIALITY_CODE = createField(DSL.name("education_speciality_code"), SQLDataType.VARCHAR, this, "Код специальности");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.qualification</code>.
     * Признанная в соответствие с законодательством РФ квалификация (степень)
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> QUALIFICATION = createField(DSL.name("qualification"), SQLDataType.VARCHAR, this, "Признанная в соответствие с законодательством РФ квалификация (степень)");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.oksm_code</code>.
     * Код страны, выдавшей документ об иностранном образовании
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> OKSM_CODE = createField(DSL.name("oksm_code"), SQLDataType.VARCHAR, this, "Код страны, выдавшей документ об иностранном образовании");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.study_field</code>.
     * Признанное в соответствие с законодательством РФ                         
     *         направление подготовки по дополнительному профессиональному
     * образованию
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> STUDY_FIELD = createField(DSL.name("study_field"), SQLDataType.VARCHAR, this, "Признанное в соответствие с законодательством РФ                                  направление подготовки по дополнительному профессиональному образованию");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.education_certificate_number</code>.
     * Уникальный номер свидетельства о признании               иностранного
     * документа об образовании
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> EDUCATION_CERTIFICATE_NUMBER = createField(DSL.name("education_certificate_number"), SQLDataType.VARCHAR, this, "Уникальный номер свидетельства о признании               иностранного документа об образовании");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.recognition_date</code>.
     * Дата признания документа об образовании
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, Date> RECOGNITION_DATE = createField(DSL.name("recognition_date"), SQLDataType.DATE, this, "Дата признания документа об образовании");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.education_level_code</code>.
     * Код уровня образования
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> EDUCATION_LEVEL_CODE = createField(DSL.name("education_level_code"), SQLDataType.VARCHAR, this, "Код уровня образования");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.vus_spec</code>.
     * Признак наличия специальности/направления подготовки/профессии
     * относящейся                        к перечню, при наличии которых
     * граждане женского пола получают                        военно-учетные
     * специальности и подлежат постановке на воинский учет
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, Boolean> VUS_SPEC = createField(DSL.name("vus_spec"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "Признак наличия специальности/направления подготовки/профессии относящейся                        к перечню, при наличии которых граждане женского пола получают                        военно-учетные специальности и подлежат постановке на воинский учет");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.doc_reg_num</code>.
     * Регистрационный номер документа об образовании
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> DOC_REG_NUM = createField(DSL.name("doc_reg_num"), SQLDataType.VARCHAR, this, "Регистрационный номер документа об образовании");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.doc_reg_series</code>.
     * Серия документа об образовании
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> DOC_REG_SERIES = createField(DSL.name("doc_reg_series"), SQLDataType.VARCHAR, this, "Серия документа об образовании");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.foreign_doc_name</code>.
     * Наименование иностранного документа
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> FOREIGN_DOC_NAME = createField(DSL.name("foreign_doc_name"), SQLDataType.VARCHAR, this, "Наименование иностранного документа");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.education_institution_name</code>.
     * Наименование образовательного учреждения
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> EDUCATION_INSTITUTION_NAME = createField(DSL.name("education_institution_name"), SQLDataType.CLOB, this, "Наименование образовательного учреждения");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.education_speciality_minpobr_code</code>.
     * Код вида документа минобразования
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> EDUCATION_SPECIALITY_MINPOBR_CODE = createField(DSL.name("education_speciality_minpobr_code"), SQLDataType.VARCHAR, this, "Код вида документа минобразования");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.education_speciality_minprosv_code</code>.
     * Код вида документа минобразования
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, String> EDUCATION_SPECIALITY_MINPROSV_CODE = createField(DSL.name("education_speciality_minprosv_code"), SQLDataType.VARCHAR, this, "Код вида документа минобразования");

    /**
     * The column
     * <code>ervu_dashboard.citizen_foreign_education_diploma.recruit_id</code>.
     * Идентификатор рекрута
     */
    public final TableField<CitizenForeignEducationDiplomaRecord, UUID> RECRUIT_ID = createField(DSL.name("recruit_id"), SQLDataType.UUID.nullable(false), this, "Идентификатор рекрута");

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

    private CitizenForeignEducationDiploma(Name alias, Table<CitizenForeignEducationDiplomaRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Иностранный диплом/аттестат гражданина"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased
     * <code>ervu_dashboard.citizen_foreign_education_diploma</code> table
     * reference
     */
    public CitizenForeignEducationDiploma(Name alias) {
        this(alias, CITIZEN_FOREIGN_EDUCATION_DIPLOMA);
    }

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

    public <O extends Record> CitizenForeignEducationDiploma(Table<O> path, ForeignKey<O, CitizenForeignEducationDiplomaRecord> childPath, InverseForeignKey<O, CitizenForeignEducationDiplomaRecord> parentPath) {
        super(path, childPath, parentPath, CITIZEN_FOREIGN_EDUCATION_DIPLOMA);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<CitizenForeignEducationDiplomaRecord> getPrimaryKey() {
        return Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA_PKEY;
    }

    @Override
    public List<ForeignKey<CitizenForeignEducationDiplomaRecord, ?>> getReferences() {
        return Arrays.asList(Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_FOREIGN_EDUCATION_DIPLOMA_COUNTRY_OKSM_CODE_FK, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_LEVEL_CODE_FK, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_FOREIGN_EDUCATION_DIPLOMA_EDUCATION_MINOBR_SPECIALITY_C, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINPROSV_SPECIALITY_CODE_FK);
    }

    private transient CountryOksmPath _countryOksm;

    /**
     * Get the implicit join path to the
     * <code>ervu_dashboard.country_oksm</code> table.
     */
    public CountryOksmPath countryOksm() {
        if (_countryOksm == null)
            _countryOksm = new CountryOksmPath(this, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_FOREIGN_EDUCATION_DIPLOMA_COUNTRY_OKSM_CODE_FK, null);

        return _countryOksm;
    }

    private transient EducationLevelPath _educationLevel;

    /**
     * Get the implicit join path to the
     * <code>ervu_dashboard.education_level</code> table.
     */
    public EducationLevelPath educationLevel() {
        if (_educationLevel == null)
            _educationLevel = new EducationLevelPath(this, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_LEVEL_CODE_FK, null);

        return _educationLevel;
    }

    private transient EducationMinobrSpecialityPath _educationMinobrSpeciality;

    /**
     * Get the implicit join path to the
     * <code>ervu_dashboard.education_minobr_speciality</code> table.
     */
    public EducationMinobrSpecialityPath educationMinobrSpeciality() {
        if (_educationMinobrSpeciality == null)
            _educationMinobrSpeciality = new EducationMinobrSpecialityPath(this, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_FOREIGN_EDUCATION_DIPLOMA_EDUCATION_MINOBR_SPECIALITY_C, null);

        return _educationMinobrSpeciality;
    }

    private transient EducationMinprosvSpecialityPath _educationMinprosvSpeciality;

    /**
     * Get the implicit join path to the
     * <code>ervu_dashboard.education_minprosv_speciality</code> table.
     */
    public EducationMinprosvSpecialityPath educationMinprosvSpeciality() {
        if (_educationMinprosvSpeciality == null)
            _educationMinprosvSpeciality = new EducationMinprosvSpecialityPath(this, Keys.CITIZEN_FOREIGN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINPROSV_SPECIALITY_CODE_FK, null);

        return _educationMinprosvSpeciality;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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