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


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

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.CitizenshipForeignRecord;


/**
 * сведения об иностранном гражданстве
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CitizenshipForeign extends TableImpl<CitizenshipForeignRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.citizenship_foreign</code>
     */
    public static final CitizenshipForeign CITIZENSHIP_FOREIGN = new CitizenshipForeign();

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

    /**
     * The column
     * <code>ervu_dashboard.citizenship_foreign.citizenship_foreign_id</code>.
     */
    public final TableField<CitizenshipForeignRecord, Long> CITIZENSHIP_FOREIGN_ID = createField(DSL.name("citizenship_foreign_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ervu_dashboard.citizenship_foreign.recruit_id</code>.
     * ссылка на гражданина (citizen)
     */
    public final TableField<CitizenshipForeignRecord, UUID> RECRUIT_ID = createField(DSL.name("recruit_id"), SQLDataType.UUID.nullable(false), this, "ссылка на гражданина (citizen)");

    /**
     * The column <code>ervu_dashboard.citizenship_foreign.country_name</code>.
     * наименование государства
     */
    public final TableField<CitizenshipForeignRecord, String> COUNTRY_NAME = createField(DSL.name("country_name"), SQLDataType.CLOB, this, "наименование государства");

    /**
     * The column
     * <code>ervu_dashboard.citizenship_foreign.residense_right_basis</code>.
     * основание получения права на постоянное проживание
     */
    public final TableField<CitizenshipForeignRecord, String> RESIDENSE_RIGHT_BASIS = createField(DSL.name("residense_right_basis"), SQLDataType.CLOB, this, "основание получения права на постоянное проживание");

    /**
     * The column
     * <code>ervu_dashboard.citizenship_foreign.residense_right_date</code>.
     * дата возникновения права на постоянное проживание
     */
    public final TableField<CitizenshipForeignRecord, Date> RESIDENSE_RIGHT_DATE = createField(DSL.name("residense_right_date"), SQLDataType.DATE, this, "дата возникновения права на постоянное проживание");

    /**
     * The column
     * <code>ervu_dashboard.citizenship_foreign.citizenship_basis</code>.
     * основание получения иностранного гражданства
     */
    public final TableField<CitizenshipForeignRecord, String> CITIZENSHIP_BASIS = createField(DSL.name("citizenship_basis"), SQLDataType.CLOB, this, "основание получения иностранного гражданства");

    /**
     * The column
     * <code>ervu_dashboard.citizenship_foreign.citizenship_date</code>. дата
     * получения иностранного гражданства
     */
    public final TableField<CitizenshipForeignRecord, Date> CITIZENSHIP_DATE = createField(DSL.name("citizenship_date"), SQLDataType.DATE, this, "дата получения иностранного гражданства");

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

    private CitizenshipForeign(Name alias, Table<CitizenshipForeignRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения об иностранном гражданстве"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.citizenship_foreign</code> table
     * reference
     */
    public CitizenshipForeign(Name alias) {
        this(alias, CITIZENSHIP_FOREIGN);
    }

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

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

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

    @Override
    public UniqueKey<CitizenshipForeignRecord> getPrimaryKey() {
        return Keys.PK_CITIZENSHIP_FOREIGN;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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