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


/**
 * Подлежат постановке на учет
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Enroll extends TableImpl<EnrollRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>forecast.enroll</code>
     */
    public static final Enroll ENROLL = new Enroll();

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

    /**
     * The column <code>forecast.enroll.enroll_id</code>.
     */
    public final TableField<EnrollRecord, Long> ENROLL_ID = createField(DSL.name("enroll_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>forecast.enroll.recording_date</code>.
     */
    public final TableField<EnrollRecord, 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.enroll.schema</code>.
     */
    public final TableField<EnrollRecord, 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.enroll.study</code>. Учатся
     */
    public final TableField<EnrollRecord, BigDecimal> STUDY = createField(DSL.name("study"), SQLDataType.NUMERIC, this, "Учатся");

    /**
     * The column <code>forecast.enroll.work</code>. Работают
     */
    public final TableField<EnrollRecord, BigDecimal> WORK = createField(DSL.name("work"), SQLDataType.NUMERIC, this, "Работают");

    /**
     * The column <code>forecast.enroll.unemployed</code>. Безработные
     */
    public final TableField<EnrollRecord, BigDecimal> UNEMPLOYED = createField(DSL.name("unemployed"), SQLDataType.NUMERIC, this, "Безработные");

    /**
     * The column <code>forecast.enroll.count_17_years</code>. 17 л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_17_YEARS = createField(DSL.name("count_17_years"), SQLDataType.NUMERIC, this, "17 л.");

    /**
     * The column <code>forecast.enroll.count_18_26_years</code>. 18-26 л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_18_26_YEARS = createField(DSL.name("count_18_26_years"), SQLDataType.NUMERIC, this, "18-26 л.");

    /**
     * The column <code>forecast.enroll.count_27_30_years</code>. 27-30 л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_27_30_YEARS = createField(DSL.name("count_27_30_years"), SQLDataType.NUMERIC, this, "27-30 л.");

    /**
     * The column <code>forecast.enroll.count_31_35_years</code>. 31-35 л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_31_35_YEARS = createField(DSL.name("count_31_35_years"), SQLDataType.NUMERIC, this, "31-35 л.");

    /**
     * The column <code>forecast.enroll.count_36_40_years</code>. 36-40 л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_36_40_YEARS = createField(DSL.name("count_36_40_years"), SQLDataType.NUMERIC, this, "36-40 л.");

    /**
     * The column <code>forecast.enroll.count_41_45_years</code>. 41-45 л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_41_45_YEARS = createField(DSL.name("count_41_45_years"), SQLDataType.NUMERIC, this, "41-45 л.");

    /**
     * The column <code>forecast.enroll.count_46_50_years</code>. 46-50 л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_46_50_YEARS = createField(DSL.name("count_46_50_years"), SQLDataType.NUMERIC, this, "46-50 л.");

    /**
     * The column <code>forecast.enroll.count_51_years</code>. 51+ л.
     */
    public final TableField<EnrollRecord, BigDecimal> COUNT_51_YEARS = createField(DSL.name("count_51_years"), SQLDataType.NUMERIC, this, "51+ л.");

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

    private Enroll(Name alias, Table<EnrollRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Подлежат постановке на учет"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>forecast.enroll</code> table reference
     */
    public Enroll(Name alias) {
        this(alias, ENROLL);
    }

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

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

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

    @Override
    public UniqueKey<EnrollRecord> getPrimaryKey() {
        return Keys.PK_ENROLL;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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