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


import ervu_dashboard.ervu_dashboard.db_beans.ervu_dashboard.ErvuDashboard;
import ervu_dashboard.ervu_dashboard.db_beans.ervu_dashboard.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.ervu_dashboard.tables.records.DisabilityRecord;

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;


/**
 * сведения об инвалидности/недееспособности/ограниченной дееспособности
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Disability extends TableImpl<DisabilityRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.disability</code>
     */
    public static final Disability DISABILITY = new Disability();

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

    /**
     * The column <code>ervu_dashboard.disability.disability_id</code>.
     */
    public final TableField<DisabilityRecord, Long> DISABILITY_ID = createField(DSL.name("disability_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.disability.disability</code>. сведения об
     * инвалидности(true)/недееспособности(false)
     */
    public final TableField<DisabilityRecord, Boolean> DISABILITY_ = createField(DSL.name("disability"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "сведения об инвалидности(true)/недееспособности(false)");

    /**
     * The column <code>ervu_dashboard.disability.organization_name</code>.
     * наименование организации, установившей инвалидность/судебного органа
     */
    public final TableField<DisabilityRecord, String> ORGANIZATION_NAME = createField(DSL.name("organization_name"), SQLDataType.VARCHAR(300), this, "наименование организации, установившей инвалидность/судебного органа");

    /**
     * The column <code>ervu_dashboard.disability.start_date</code>. дата
     * установления инвалидности/признания гражданина недееспособным
     */
    public final TableField<DisabilityRecord, Date> START_DATE = createField(DSL.name("start_date"), SQLDataType.DATE, this, "дата установления инвалидности/признания гражданина недееспособным");

    /**
     * The column <code>ervu_dashboard.disability.close_date</code>. дата снятия
     * инвалидности/отмены ограничения гражданина в дееспособности
     */
    public final TableField<DisabilityRecord, Date> CLOSE_DATE = createField(DSL.name("close_date"), SQLDataType.DATE, this, "дата снятия инвалидности/отмены ограничения гражданина в дееспособности");

    /**
     * The column <code>ervu_dashboard.disability.confirmation_date</code>. дата
     * подтверждения инвалидности
     */
    public final TableField<DisabilityRecord, Date> CONFIRMATION_DATE = createField(DSL.name("confirmation_date"), SQLDataType.DATE, this, "дата подтверждения инвалидности");

    /**
     * The column <code>ervu_dashboard.disability.re_examination_date</code>.
     * дата переосвидетельствования по инвалидности
     */
    public final TableField<DisabilityRecord, Date> RE_EXAMINATION_DATE = createField(DSL.name("re_examination_date"), SQLDataType.DATE, this, "дата переосвидетельствования по инвалидности");

    /**
     * The column <code>ervu_dashboard.disability.disability_group</code>.
     * группа инвалидности
     */
    public final TableField<DisabilityRecord, String> DISABILITY_GROUP = createField(DSL.name("disability_group"), SQLDataType.VARCHAR(30), this, "группа инвалидности");

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

    private Disability(Name alias, Table<DisabilityRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения об инвалидности/недееспособности/ограниченной дееспособности"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.disability</code> table reference
     */
    public Disability(Name alias) {
        this(alias, DISABILITY);
    }

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

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

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

    @Override
    public UniqueKey<DisabilityRecord> getPrimaryKey() {
        return Keys.PK_DISABILITY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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