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


import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;
import ervu_dashboard.ervu_dashboard.db_beans.ratings.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.ratings.Ratings;
import ervu_dashboard.ervu_dashboard.db_beans.ratings.tables.records.RecruitmentRecord;
import ervu_dashboard.ervu_dashboard.db_beans.space.tables.Region.RegionPath;

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 Recruitment extends TableImpl<RecruitmentRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ratings.recruitment</code>
     */
    public static final Recruitment RECRUITMENT = new Recruitment();

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

    /**
     * The column <code>ratings.recruitment.id_recruitment</code>.
     */
    public final TableField<RecruitmentRecord, Long> ID_RECRUITMENT = createField(DSL.name("id_recruitment"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ratings.recruitment.id_region</code>.
     */
    public final TableField<RecruitmentRecord, Integer> ID_REGION = createField(DSL.name("id_region"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>ratings.recruitment.execution</code>. Исполнение плана
     * призыва
     */
    public final TableField<RecruitmentRecord, BigDecimal> EXECUTION = createField(DSL.name("execution"), SQLDataType.NUMERIC, this, "Исполнение плана призыва");

    /**
     * The column <code>ratings.recruitment.spring_autumn</code>. Осень/весна
     */
    public final TableField<RecruitmentRecord, String> SPRING_AUTUMN = createField(DSL.name("spring_autumn"), SQLDataType.CLOB, this, "Осень/весна");

    /**
     * The column <code>ratings.recruitment.recording_date</code>. Дата записи
     */
    public final TableField<RecruitmentRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE, this, "Дата записи");

    /**
     * The column <code>ratings.recruitment.execution_percent</code>. Исолнение
     * плана призыва в процентах
     */
    public final TableField<RecruitmentRecord, BigDecimal> EXECUTION_PERCENT = createField(DSL.name("execution_percent"), SQLDataType.NUMERIC, this, "Исолнение плана призыва в процентах");

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

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

    private Recruitment(Name alias, Table<RecruitmentRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Призыв уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>ratings.recruitment</code> table reference
     */
    public Recruitment(String alias) {
        this(DSL.name(alias), RECRUITMENT);
    }

    /**
     * Create an aliased <code>ratings.recruitment</code> table reference
     */
    public Recruitment(Name alias) {
        this(alias, RECRUITMENT);
    }

    /**
     * Create a <code>ratings.recruitment</code> table reference
     */
    public Recruitment() {
        this(DSL.name("recruitment"), null);
    }

    public <O extends Record> Recruitment(Table<O> path, ForeignKey<O, RecruitmentRecord> childPath, InverseForeignKey<O, RecruitmentRecord> parentPath) {
        super(path, childPath, parentPath, RECRUITMENT);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<RecruitmentRecord> getPrimaryKey() {
        return Keys.PK_RECRUITMENT;
    }

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

    private transient RegionPath _region;

    /**
     * Get the implicit join path to the <code>space.region</code> table.
     */
    public RegionPath region() {
        if (_region == null)
            _region = new RegionPath(this, Keys.RECRUITMENT__FK_REGION, null);

        return _region;
    }

    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.RECRUITMENT__R_RECRUITMENT_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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