/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables;


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

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.webbpm.ervu.business_metrics.db_beans.metrics.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.Metrics;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.records.RecordsAboutCitizenRecord;


/**
 * Обжалования. Записи о гражданах, обновленных в ГИС ЕРВУ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RecordsAboutCitizen extends TableImpl<RecordsAboutCitizenRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>metrics.records_about_citizen</code>
     */
    public static final RecordsAboutCitizen RECORDS_ABOUT_CITIZEN = new RecordsAboutCitizen();

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

    /**
     * The column
     * <code>metrics.records_about_citizen.records_about_citizen_id</code>.
     */
    public final TableField<RecordsAboutCitizenRecord, Long> RECORDS_ABOUT_CITIZEN_ID = createField(DSL.name("records_about_citizen_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>metrics.records_about_citizen.recruitment_id</code>.
     */
    public final TableField<RecordsAboutCitizenRecord, String> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

    /**
     * The column <code>metrics.records_about_citizen.update_date</code>.
     */
    public final TableField<RecordsAboutCitizenRecord, Timestamp> UPDATE_DATE = createField(DSL.name("update_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");

    /**
     * The column <code>metrics.records_about_citizen.info_date</code>.
     */
    public final TableField<RecordsAboutCitizenRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column
     * <code>metrics.records_about_citizen.count_records_about_citizen</code>.
     */
    public final TableField<RecordsAboutCitizenRecord, Long> COUNT_RECORDS_ABOUT_CITIZEN = createField(DSL.name("count_records_about_citizen"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private RecordsAboutCitizen(Name alias, Table<RecordsAboutCitizenRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Обжалования. Записи о гражданах, обновленных в ГИС ЕРВУ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>metrics.records_about_citizen</code> table
     * reference
     */
    public RecordsAboutCitizen(String alias) {
        this(DSL.name(alias), RECORDS_ABOUT_CITIZEN);
    }

    /**
     * Create an aliased <code>metrics.records_about_citizen</code> table
     * reference
     */
    public RecordsAboutCitizen(Name alias) {
        this(alias, RECORDS_ABOUT_CITIZEN);
    }

    /**
     * Create a <code>metrics.records_about_citizen</code> table reference
     */
    public RecordsAboutCitizen() {
        this(DSL.name("records_about_citizen"), null);
    }

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

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

    @Override
    public UniqueKey<RecordsAboutCitizenRecord> getPrimaryKey() {
        return Keys.RECORDS_ABOUT_CITIZEN_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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