/*
 * 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.enums.EmployerCategoryType;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.records.WorkRecord;


/**
 * сведения об имуществе
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Work extends TableImpl<WorkRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.work</code>
     */
    public static final Work WORK = new Work();

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

    /**
     * The column <code>ervu_dashboard.work.work_id</code>.
     */
    public final TableField<WorkRecord, Long> WORK_ID = createField(DSL.name("work_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.work.employer_category</code>. категория
     * работодателя: юр лицо/ИП/физ лицо/глава КФХ
     */
    public final TableField<WorkRecord, EmployerCategoryType> EMPLOYER_CATEGORY = createField(DSL.name("employer_category"), SQLDataType.VARCHAR.asEnumDataType(EmployerCategoryType.class), this, "категория работодателя: юр лицо/ИП/физ лицо/глава КФХ");

    /**
     * The column <code>ervu_dashboard.work.place</code>. место работы
     */
    public final TableField<WorkRecord, String> PLACE = createField(DSL.name("place"), SQLDataType.CLOB, this, "место работы");

    /**
     * The column <code>ervu_dashboard.work.organization_name</code>.
     * наименование организации
     */
    public final TableField<WorkRecord, String> ORGANIZATION_NAME = createField(DSL.name("organization_name"), SQLDataType.VARCHAR(100), this, "наименование организации");

    /**
     * The column <code>ervu_dashboard.work.inn</code>. ИНН
     */
    public final TableField<WorkRecord, String> INN = createField(DSL.name("inn"), SQLDataType.VARCHAR(15), this, "ИНН");

    /**
     * The column <code>ervu_dashboard.work.kpp</code>. КПП
     */
    public final TableField<WorkRecord, String> KPP = createField(DSL.name("kpp"), SQLDataType.VARCHAR(15), this, "КПП");

    /**
     * The column <code>ervu_dashboard.work.ogrnip</code>. ОГРНИП
     */
    public final TableField<WorkRecord, String> OGRNIP = createField(DSL.name("ogrnip"), SQLDataType.VARCHAR(20), this, "ОГРНИП");

    /**
     * The column <code>ervu_dashboard.work.position</code>. должность
     */
    public final TableField<WorkRecord, String> POSITION = createField(DSL.name("position"), SQLDataType.VARCHAR(150), this, "должность");

    /**
     * The column <code>ervu_dashboard.work.event_type</code>. тип кадрового
     * мероприятия 
     */
    public final TableField<WorkRecord, String> EVENT_TYPE = createField(DSL.name("event_type"), SQLDataType.VARCHAR(50), this, "тип кадрового мероприятия ");

    /**
     * The column <code>ervu_dashboard.work.event_date</code>. дата кадрового
     * мероприятия
     */
    public final TableField<WorkRecord, Date> EVENT_DATE = createField(DSL.name("event_date"), SQLDataType.DATE, this, "дата кадрового мероприятия");

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

    private Work(Name alias, Table<WorkRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения об имуществе"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.work</code> table reference
     */
    public Work(Name alias) {
        this(alias, WORK);
    }

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

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

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

    @Override
    public UniqueKey<WorkRecord> getPrimaryKey() {
        return Keys.PK_WORK;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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