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


import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;
import ervu_dashboard.ervu_dashboard.db_beans.recruitment_campaign.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.recruitment_campaign.RecruitmentCampaign;
import ervu_dashboard.ervu_dashboard.db_beans.recruitment_campaign.tables.records.RecruitmentRecord;

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;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Recruitment extends TableImpl<RecruitmentRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>recruitment_campaign.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>recruitment_campaign.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>recruitment_campaign.recruitment.suitable_recruit</code>. Подходят
     * под призыв
     */
    public final TableField<RecruitmentRecord, BigDecimal> SUITABLE_RECRUIT = createField(DSL.name("suitable_recruit"), SQLDataType.NUMERIC, this, "Подходят под призыв");

    /**
     * The column
     * <code>recruitment_campaign.recruitment.postponement_have_right</code>.
     * Имеют право на отсрочку
     */
    public final TableField<RecruitmentRecord, BigDecimal> POSTPONEMENT_HAVE_RIGHT = createField(DSL.name("postponement_have_right"), SQLDataType.NUMERIC, this, "Имеют право на отсрочку");

    /**
     * The column
     * <code>recruitment_campaign.recruitment.postponement_granted</code>.
     * Предоставлена отсрочка
     */
    public final TableField<RecruitmentRecord, BigDecimal> POSTPONEMENT_GRANTED = createField(DSL.name("postponement_granted"), SQLDataType.NUMERIC, this, "Предоставлена отсрочка");

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

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

    /**
     * The column
     * <code>recruitment_campaign.recruitment.postponement_have_right_percent</code>.
     * Процент имеющих право на отсрочку
     */
    public final TableField<RecruitmentRecord, BigDecimal> POSTPONEMENT_HAVE_RIGHT_PERCENT = createField(DSL.name("postponement_have_right_percent"), SQLDataType.NUMERIC, this, "Процент имеющих право на отсрочку");

    /**
     * The column
     * <code>recruitment_campaign.recruitment.postponement_granted_percent</code>.
     * Процент предоставленных отсрочек
     */
    public final TableField<RecruitmentRecord, BigDecimal> POSTPONEMENT_GRANTED_PERCENT = createField(DSL.name("postponement_granted_percent"), SQLDataType.NUMERIC, this, "Процент предоставленных отсрочек");

    /**
     * The column <code>recruitment_campaign.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>recruitment_campaign.recruitment</code> table
     * reference
     */
    public Recruitment(String alias) {
        this(DSL.name(alias), RECRUITMENT);
    }

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

    /**
     * Create a <code>recruitment_campaign.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 : RecruitmentCampaign.RECRUITMENT_CAMPAIGN;
    }

    @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__RC_RECRUITMENT_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.RECRUITMENT__RC_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));
    }
}
