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


import java.math.BigDecimal;
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.forecast.Forecast;
import ru.micord.ervu_dashboard.db_beans.forecast.Keys;
import ru.micord.ervu_dashboard.db_beans.forecast.tables.records.RegisteredCitizensRecord;


/**
 * Динамика количества граждан на учете
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RegisteredCitizens extends TableImpl<RegisteredCitizensRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>forecast.registered_citizens</code>
     */
    public static final RegisteredCitizens REGISTERED_CITIZENS = new RegisteredCitizens();

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

    /**
     * The column
     * <code>forecast.registered_citizens.registered_citizens_id</code>.
     */
    public final TableField<RegisteredCitizensRecord, Long> REGISTERED_CITIZENS_ID = createField(DSL.name("registered_citizens_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>forecast.registered_citizens.recruitment_id</code>.
     */
    public final TableField<RegisteredCitizensRecord, UUID> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.UUID.nullable(false), this, "");

    /**
     * The column <code>forecast.registered_citizens.recording_date</code>.
     */
    public final TableField<RegisteredCitizensRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.DATE)), this, "");

    /**
     * The column <code>forecast.registered_citizens.schema</code>.
     */
    public final TableField<RegisteredCitizensRecord, String> SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(64).nullable(false).defaultValue(DSL.field(DSL.raw("'empty'::character varying"), SQLDataType.VARCHAR)), this, "");

    /**
     * The column <code>forecast.registered_citizens.count_all</code>. Всего на
     * учете
     */
    public final TableField<RegisteredCitizensRecord, BigDecimal> COUNT_ALL = createField(DSL.name("count_all"), SQLDataType.NUMERIC, this, "Всего на учете");

    /**
     * The column <code>forecast.registered_citizens.reaching_17_age</code>. В
     * год достижения 17 лет
     */
    public final TableField<RegisteredCitizensRecord, BigDecimal> REACHING_17_AGE = createField(DSL.name("reaching_17_age"), SQLDataType.NUMERIC, this, "В год достижения 17 лет");

    /**
     * The column
     * <code>forecast.registered_citizens.women_military_specialty</code>.
     * Женщины, получившие ВУС
     */
    public final TableField<RegisteredCitizensRecord, BigDecimal> WOMEN_MILITARY_SPECIALTY = createField(DSL.name("women_military_specialty"), SQLDataType.NUMERIC, this, "Женщины, получившие ВУС");

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

    private RegisteredCitizens(Name alias, Table<RegisteredCitizensRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Динамика количества граждан на учете"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>forecast.registered_citizens</code> table
     * reference
     */
    public RegisteredCitizens(String alias) {
        this(DSL.name(alias), REGISTERED_CITIZENS);
    }

    /**
     * Create an aliased <code>forecast.registered_citizens</code> table
     * reference
     */
    public RegisteredCitizens(Name alias) {
        this(alias, REGISTERED_CITIZENS);
    }

    /**
     * Create a <code>forecast.registered_citizens</code> table reference
     */
    public RegisteredCitizens() {
        this(DSL.name("registered_citizens"), null);
    }

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

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

    @Override
    public UniqueKey<RegisteredCitizensRecord> getPrimaryKey() {
        return Keys.PK_REGISTERED_CITIZENS;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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