/*
 * This file is generated by jOOQ.
 */
package ervu_dashboard.ervu_dashboard.db_beans.total_registered.tables;


import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.TotalRegistered;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.tables.records.BusynessRecord;

import java.math.BigDecimal;
import java.sql.Date;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.UUID;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Path;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.Record;
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 Busyness extends TableImpl<BusynessRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>total_registered.busyness</code>
     */
    public static final Busyness BUSYNESS = new Busyness();

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

    /**
     * The column <code>total_registered.busyness.id_busyness</code>.
     */
    public final TableField<BusynessRecord, Long> ID_BUSYNESS = createField(DSL.name("id_busyness"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>total_registered.busyness.study</code>. Учатся
     */
    public final TableField<BusynessRecord, BigDecimal> STUDY = createField(DSL.name("study"), SQLDataType.NUMERIC, this, "Учатся");

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

    /**
     * The column <code>total_registered.busyness.not_work</code>. Безработные
     */
    public final TableField<BusynessRecord, BigDecimal> NOT_WORK = createField(DSL.name("not_work"), SQLDataType.NUMERIC, this, "Безработные");

    /**
     * The column <code>total_registered.busyness.all_M_W</code>.
     * Все/Мужчины/Женщины
     */
    public final TableField<BusynessRecord, String> ALL_M_W = createField(DSL.name("all_M_W"), SQLDataType.CLOB, this, "Все/Мужчины/Женщины");

    /**
     * The column <code>total_registered.busyness.registered</code>. Состоит на
     * учете/не состоит
     */
    public final TableField<BusynessRecord, Boolean> REGISTERED = createField(DSL.name("registered"), SQLDataType.BOOLEAN, this, "Состоит на учете/не состоит");

    /**
     * The column <code>total_registered.busyness.recording_date</code>. Дата
     * записи
     */
    public final TableField<BusynessRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.DATE)), this, "Дата записи");

    /**
     * The column <code>total_registered.busyness.study_percent</code>. Учатся в
     * процентах
     */
    public final TableField<BusynessRecord, BigDecimal> STUDY_PERCENT = createField(DSL.name("study_percent"), SQLDataType.NUMERIC, this, "Учатся в процентах");

    /**
     * The column <code>total_registered.busyness.work_percent</code>. Работают
     * в процентах
     */
    public final TableField<BusynessRecord, BigDecimal> WORK_PERCENT = createField(DSL.name("work_percent"), SQLDataType.NUMERIC, this, "Работают в процентах");

    /**
     * The column <code>total_registered.busyness.not_work_percent</code>.
     * Безработные в процентах
     */
    public final TableField<BusynessRecord, BigDecimal> NOT_WORK_PERCENT = createField(DSL.name("not_work_percent"), SQLDataType.NUMERIC, this, "Безработные в процентах");

    /**
     * The column <code>total_registered.busyness.recruitment_id</code>.
     */
    public final TableField<BusynessRecord, UUID> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.UUID, this, "");

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

    private Busyness(Name alias, Table<BusynessRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Занятость состоящих/не состоящих, мужчин/женщин/всех на учете уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>total_registered.busyness</code> table reference
     */
    public Busyness(String alias) {
        this(DSL.name(alias), BUSYNESS);
    }

    /**
     * Create an aliased <code>total_registered.busyness</code> table reference
     */
    public Busyness(Name alias) {
        this(alias, BUSYNESS);
    }

    /**
     * Create a <code>total_registered.busyness</code> table reference
     */
    public Busyness() {
        this(DSL.name("busyness"), null);
    }

    public <O extends Record> Busyness(Table<O> path, ForeignKey<O, BusynessRecord> childPath, InverseForeignKey<O, BusynessRecord> parentPath) {
        super(path, childPath, parentPath, BUSYNESS);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class BusynessPath extends Busyness implements Path<BusynessRecord> {
        public <O extends Record> BusynessPath(Table<O> path, ForeignKey<O, BusynessRecord> childPath, InverseForeignKey<O, BusynessRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private BusynessPath(Name alias, Table<BusynessRecord> aliased) {
            super(alias, aliased);
        }

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

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

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

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

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

    @Override
    public UniqueKey<BusynessRecord> getPrimaryKey() {
        return Keys.PK_BUSYNESS;
    }

    @Override
    public List<ForeignKey<BusynessRecord, ?>> getReferences() {
        return Arrays.asList(Keys.BUSYNESS__BUSYNESS_FK1);
    }

    private transient PubRecruitmentPath _pubRecruitment;

    /**
     * Get the implicit join path to the <code>public.pub_recruitment</code>
     * table.
     */
    public PubRecruitmentPath pubRecruitment() {
        if (_pubRecruitment == null)
            _pubRecruitment = new PubRecruitmentPath(this, Keys.BUSYNESS__BUSYNESS_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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