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


/**
 * сведения о гражданах, избранных депутатами/зарегистрированных кандидатами на
 * участие в выборах
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Deputy extends TableImpl<DeputyRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.deputy</code>
     */
    public static final Deputy DEPUTY = new Deputy();

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

    /**
     * The column <code>ervu_dashboard.deputy.deputy_id</code>.
     */
    public final TableField<DeputyRecord, Long> DEPUTY_ID = createField(DSL.name("deputy_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.deputy.deputy</code>. является
     * депутатом(true)/кандидатом на участие в выборах(false)
     */
    public final TableField<DeputyRecord, Boolean> DEPUTY_ = createField(DSL.name("deputy"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "является депутатом(true)/кандидатом на участие в выборах(false)");

    /**
     * The column <code>ervu_dashboard.deputy.information</code>. сведения об
     * избрании гражданина депутатом/сведения о регистрации кандидатом на
     * выборах
     */
    public final TableField<DeputyRecord, String> INFORMATION = createField(DSL.name("information"), SQLDataType.CLOB, this, "сведения об избрании гражданина депутатом/сведения о регистрации кандидатом на выборах");

    /**
     * The column <code>ervu_dashboard.deputy.end_date</code>. дата досрочного
     * прекращения полномочий/снятия кандидатуры с выборов
     */
    public final TableField<DeputyRecord, Date> END_DATE = createField(DSL.name("end_date"), SQLDataType.DATE, this, "дата досрочного прекращения полномочий/снятия кандидатуры с выборов");

    /**
     * The column <code>ervu_dashboard.deputy.period_office</code>. срок
     * полномочий
     */
    public final TableField<DeputyRecord, String> PERIOD_OFFICE = createField(DSL.name("period_office"), SQLDataType.VARCHAR(50), this, "срок полномочий");

    /**
     * The column <code>ervu_dashboard.deputy.cancellation_date</code>. дата
     * аннулирования регистрации
     */
    public final TableField<DeputyRecord, Date> CANCELLATION_DATE = createField(DSL.name("cancellation_date"), SQLDataType.DATE, this, "дата аннулирования регистрации");

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

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

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

    /**
     * Create an aliased <code>ervu_dashboard.deputy</code> table reference
     */
    public Deputy(Name alias) {
        this(alias, DEPUTY);
    }

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

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

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

    @Override
    public UniqueKey<DeputyRecord> getPrimaryKey() {
        return Keys.PK_DEPUTY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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