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


import ervu_dashboard.ervu_dashboard.db_beans.appeals.Appeals;
import ervu_dashboard.ervu_dashboard.db_beans.appeals.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.appeals.tables.records.ReasonsAppealRecord;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;

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 ReasonsAppeal extends TableImpl<ReasonsAppealRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>appeals.reasons_appeal</code>
     */
    public static final ReasonsAppeal REASONS_APPEAL = new ReasonsAppeal();

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

    /**
     * The column <code>appeals.reasons_appeal.id_reasons_appeal</code>.
     */
    public final TableField<ReasonsAppealRecord, Long> ID_REASONS_APPEAL = createField(DSL.name("id_reasons_appeal"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>appeals.reasons_appeal.appeal</code>. Обжалования
     */
    public final TableField<ReasonsAppealRecord, BigDecimal> APPEAL = createField(DSL.name("appeal"), SQLDataType.NUMERIC, this, "Обжалования");

    /**
     * The column <code>appeals.reasons_appeal.incorrect_inf</code>.
     * Некорректные сведения
     */
    public final TableField<ReasonsAppealRecord, BigDecimal> INCORRECT_INF = createField(DSL.name("incorrect_inf"), SQLDataType.NUMERIC, this, "Некорректные сведения");

    /**
     * The column <code>appeals.reasons_appeal.no_data</code>. Нет данных
     */
    public final TableField<ReasonsAppealRecord, BigDecimal> NO_DATA = createField(DSL.name("no_data"), SQLDataType.NUMERIC, this, "Нет данных");

    /**
     * The column <code>appeals.reasons_appeal.other</code>. Прочее
     */
    public final TableField<ReasonsAppealRecord, BigDecimal> OTHER = createField(DSL.name("other"), SQLDataType.NUMERIC, this, "Прочее");

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

    /**
     * The column <code>appeals.reasons_appeal.incorrect_inf_percent</code>.
     * Некорректные сведения в процентах
     */
    public final TableField<ReasonsAppealRecord, BigDecimal> INCORRECT_INF_PERCENT = createField(DSL.name("incorrect_inf_percent"), SQLDataType.NUMERIC, this, "Некорректные сведения в процентах");

    /**
     * The column <code>appeals.reasons_appeal.no_data_percent</code>. Нет
     * данных в процентах
     */
    public final TableField<ReasonsAppealRecord, BigDecimal> NO_DATA_PERCENT = createField(DSL.name("no_data_percent"), SQLDataType.NUMERIC, this, "Нет данных в процентах");

    /**
     * The column <code>appeals.reasons_appeal.other_percent</code>. Прочее в
     * процентах
     */
    public final TableField<ReasonsAppealRecord, BigDecimal> OTHER_PERCENT = createField(DSL.name("other_percent"), SQLDataType.NUMERIC, this, "Прочее в процентах");

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

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

    private ReasonsAppeal(Name alias, Table<ReasonsAppealRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Причины обжалования уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>appeals.reasons_appeal</code> table reference
     */
    public ReasonsAppeal(String alias) {
        this(DSL.name(alias), REASONS_APPEAL);
    }

    /**
     * Create an aliased <code>appeals.reasons_appeal</code> table reference
     */
    public ReasonsAppeal(Name alias) {
        this(alias, REASONS_APPEAL);
    }

    /**
     * Create a <code>appeals.reasons_appeal</code> table reference
     */
    public ReasonsAppeal() {
        this(DSL.name("reasons_appeal"), null);
    }

    public <O extends Record> ReasonsAppeal(Table<O> path, ForeignKey<O, ReasonsAppealRecord> childPath, InverseForeignKey<O, ReasonsAppealRecord> parentPath) {
        super(path, childPath, parentPath, REASONS_APPEAL);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<ReasonsAppealRecord> getPrimaryKey() {
        return Keys.PK_REASONS_APPEAL;
    }

    @Override
    public List<ForeignKey<ReasonsAppealRecord, ?>> getReferences() {
        return Arrays.asList(Keys.REASONS_APPEAL__REASONS_APPEAL_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.REASONS_APPEAL__REASONS_APPEAL_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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