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

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 Disease extends TableImpl<DiseaseRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.disease</code>
     */
    public static final Disease DISEASE = new Disease();

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

    /**
     * The column <code>ervu_dashboard.disease.disease_id</code>.
     */
    public final TableField<DiseaseRecord, Long> DISEASE_ID = createField(DSL.name("disease_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.disease.code</code>. код заболевания
     */
    public final TableField<DiseaseRecord, String> CODE = createField(DSL.name("code"), SQLDataType.VARCHAR, this, "код заболевания");

    /**
     * The column <code>ervu_dashboard.disease.name</code>. наименование
     * заболевания
     */
    public final TableField<DiseaseRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR, this, "наименование заболевания");

    /**
     * The column <code>ervu_dashboard.disease.reg_date</code>. дата постановки
     * диагноза
     */
    public final TableField<DiseaseRecord, Date> REG_DATE = createField(DSL.name("reg_date"), SQLDataType.DATE, this, "дата постановки диагноза");

    /**
     * The column <code>ervu_dashboard.disease.registered</code>. поставлен на
     * учет по заболеванию
     */
    public final TableField<DiseaseRecord, Boolean> REGISTERED = createField(DSL.name("registered"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "поставлен на учет по заболеванию");

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

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

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

    /**
     * Create an aliased <code>ervu_dashboard.disease</code> table reference
     */
    public Disease(Name alias) {
        this(alias, DISEASE);
    }

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

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

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

    @Override
    public UniqueKey<DiseaseRecord> getPrimaryKey() {
        return Keys.PK_DISEASE;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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