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


/**
 * сведения о супруге (бывшей/ем супруге) гражданина
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CitizenSpouse extends TableImpl<CitizenSpouseRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.citizen_spouse</code>
     */
    public static final CitizenSpouse CITIZEN_SPOUSE = new CitizenSpouse();

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

    /**
     * The column <code>ervu_dashboard.citizen_spouse.citizen_spouse_id</code>.
     */
    public final TableField<CitizenSpouseRecord, Long> CITIZEN_SPOUSE_ID = createField(DSL.name("citizen_spouse_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.citizen_spouse.kinship_type</code>. тип
     * родственной связи: супруг/бывший супруг
     */
    public final TableField<CitizenSpouseRecord, String> KINSHIP_TYPE = createField(DSL.name("kinship_type"), SQLDataType.VARCHAR(50), this, "тип родственной связи: супруг/бывший супруг");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.full_name</code>. ФИО
     */
    public final TableField<CitizenSpouseRecord, String> FULL_NAME = createField(DSL.name("full_name"), SQLDataType.VARCHAR, this, "ФИО");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.birth_date</code>.
     */
    public final TableField<CitizenSpouseRecord, Date> BIRTH_DATE = createField(DSL.name("birth_date"), SQLDataType.DATE, this, "");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.death_az_number</code>.
     * номер актовой записи о смерти
     */
    public final TableField<CitizenSpouseRecord, String> DEATH_AZ_NUMBER = createField(DSL.name("death_az_number"), SQLDataType.VARCHAR(50), this, "номер актовой записи о смерти");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.death_date</code>.
     */
    public final TableField<CitizenSpouseRecord, Date> DEATH_DATE = createField(DSL.name("death_date"), SQLDataType.DATE, this, "");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.marriage_az_number</code>.
     * номер актовой записи о браке
     */
    public final TableField<CitizenSpouseRecord, String> MARRIAGE_AZ_NUMBER = createField(DSL.name("marriage_az_number"), SQLDataType.VARCHAR(50), this, "номер актовой записи о браке");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.marriage_date</code>.
     */
    public final TableField<CitizenSpouseRecord, Date> MARRIAGE_DATE = createField(DSL.name("marriage_date"), SQLDataType.DATE, this, "");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.divorce_az_number</code>.
     * номер актовой записи о расторжении брака
     */
    public final TableField<CitizenSpouseRecord, String> DIVORCE_AZ_NUMBER = createField(DSL.name("divorce_az_number"), SQLDataType.VARCHAR(50), this, "номер актовой записи о расторжении брака");

    /**
     * The column <code>ervu_dashboard.citizen_spouse.divorce_date</code>.
     */
    public final TableField<CitizenSpouseRecord, Date> DIVORCE_DATE = createField(DSL.name("divorce_date"), SQLDataType.DATE, this, "");

    /**
     * The column
     * <code>ervu_dashboard.citizen_spouse.information_excluded</code>. сведения
     * о супруге исключены
     */
    public final TableField<CitizenSpouseRecord, Boolean> INFORMATION_EXCLUDED = createField(DSL.name("information_excluded"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "сведения о супруге исключены");

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

    private CitizenSpouse(Name alias, Table<CitizenSpouseRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения о супруге (бывшей/ем супруге) гражданина"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.citizen_spouse</code> table
     * reference
     */
    public CitizenSpouse(Name alias) {
        this(alias, CITIZEN_SPOUSE);
    }

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

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

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

    @Override
    public UniqueKey<CitizenSpouseRecord> getPrimaryKey() {
        return Keys.PK_CITIZEN_SPOUSE;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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