/*
 * 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.EducationLevel.EducationLevelPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.EducationMinobrDocType.EducationMinobrDocTypePath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.EducationMinobrSpeciality.EducationMinobrSpecialityPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.EducationMinprosvDocType.EducationMinprosvDocTypePath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.EducationMinprosvSpeciality.EducationMinprosvSpecialityPath;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.records.CitizenEducationDiplomaRecord;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.citizen_education_diploma</code>
     */
    public static final CitizenEducationDiploma CITIZEN_EDUCATION_DIPLOMA = new CitizenEducationDiploma();

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_education_diploma.citizen_education_diploma_id</code>.
     */
    public final TableField<CitizenEducationDiplomaRecord, Long> CITIZEN_EDUCATION_DIPLOMA_ID = createField(DSL.name("citizen_education_diploma_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_education_diploma.issue_date</code>. Дата
     * выдачи
     */
    public final TableField<CitizenEducationDiplomaRecord, Date> ISSUE_DATE = createField(DSL.name("issue_date"), SQLDataType.DATE, this, "Дата выдачи");

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

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

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_education_diploma.vus_spec</code>. Признак
     * наличия специальности/направления подготовки/профессии относящейся       
     *                 к перечню, при наличии которых граждане женского пола
     * получают                        военно-учетные специальности и подлежат
     * постановке на воинский учет
     */
    public final TableField<CitizenEducationDiplomaRecord, 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_education_diploma.blank_number</code>. Номер
     * бланка документа об образовании
     */
    public final TableField<CitizenEducationDiplomaRecord, String> BLANK_NUMBER = createField(DSL.name("blank_number"), SQLDataType.VARCHAR, this, "Номер бланка документа об образовании");

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

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

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

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

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

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

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

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

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

    /**
     * Create an aliased <code>ervu_dashboard.citizen_education_diploma</code>
     * table reference
     */
    public CitizenEducationDiploma(Name alias) {
        this(alias, CITIZEN_EDUCATION_DIPLOMA);
    }

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

    public <O extends Record> CitizenEducationDiploma(Table<O> path, ForeignKey<O, CitizenEducationDiplomaRecord> childPath, InverseForeignKey<O, CitizenEducationDiplomaRecord> parentPath) {
        super(path, childPath, parentPath, CITIZEN_EDUCATION_DIPLOMA);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<CitizenEducationDiplomaRecord> getPrimaryKey() {
        return Keys.CITIZEN_EDUCATION_DIPLOMA_PKEY;
    }

    @Override
    public List<ForeignKey<CitizenEducationDiplomaRecord, ?>> getReferences() {
        return Arrays.asList(Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_LEVEL_CODE_FK, Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_MINOBR_DOC_TYPE_CODE_FK, Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_DOC_TYPE_CODE_MINPROSV_CODE_FK, Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINOBR_SPECIALITY_CODE_FK, Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINPROSV_SPECIALITY_CODE_FK);
    }

    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_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_LEVEL_CODE_FK, null);

        return _educationLevel;
    }

    private transient EducationMinobrDocTypePath _educationMinobrDocType;

    /**
     * Get the implicit join path to the
     * <code>ervu_dashboard.education_minobr_doc_type</code> table.
     */
    public EducationMinobrDocTypePath educationMinobrDocType() {
        if (_educationMinobrDocType == null)
            _educationMinobrDocType = new EducationMinobrDocTypePath(this, Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_MINOBR_DOC_TYPE_CODE_FK, null);

        return _educationMinobrDocType;
    }

    private transient EducationMinprosvDocTypePath _educationMinprosvDocType;

    /**
     * Get the implicit join path to the
     * <code>ervu_dashboard.education_minprosv_doc_type</code> table.
     */
    public EducationMinprosvDocTypePath educationMinprosvDocType() {
        if (_educationMinprosvDocType == null)
            _educationMinprosvDocType = new EducationMinprosvDocTypePath(this, Keys.CITIZEN_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_DOC_TYPE_CODE_MINPROSV_CODE_FK, null);

        return _educationMinprosvDocType;
    }

    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_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINOBR_SPECIALITY_CODE_FK, 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_EDUCATION_DIPLOMA__CITIZEN_EDUCATION_DIPLOMA_EDUCATION_MINPROSV_SPECIALITY_CODE_FK, null);

        return _educationMinprosvSpeciality;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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