/*
 * 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.TopicAppealRecord;
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 TopicAppeal extends TableImpl<TopicAppealRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>appeals.topic_appeal</code>
     */
    public static final TopicAppeal TOPIC_APPEAL = new TopicAppeal();

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

    /**
     * The column <code>appeals.topic_appeal.id_topic_appeal</code>.
     */
    public final TableField<TopicAppealRecord, Long> ID_TOPIC_APPEAL = createField(DSL.name("id_topic_appeal"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>appeals.topic_appeal.registration</code>. Тема
     * обжалования постановка на учет
     */
    public final TableField<TopicAppealRecord, BigDecimal> REGISTRATION = createField(DSL.name("registration"), SQLDataType.NUMERIC, this, "Тема обжалования постановка на учет");

    /**
     * The column <code>appeals.topic_appeal.sabpoena</code>. Тема обжалования
     * повестки
     */
    public final TableField<TopicAppealRecord, BigDecimal> SABPOENA = createField(DSL.name("sabpoena"), SQLDataType.NUMERIC, this, "Тема обжалования повестки");

    /**
     * The column <code>appeals.topic_appeal.appear</code>. Тема обжалования
     * явка
     */
    public final TableField<TopicAppealRecord, BigDecimal> APPEAR = createField(DSL.name("appear"), SQLDataType.NUMERIC, this, "Тема обжалования явка");

    /**
     * The column <code>appeals.topic_appeal.temporary_measures</code>. Тема
     * обжалования временные меры
     */
    public final TableField<TopicAppealRecord, BigDecimal> TEMPORARY_MEASURES = createField(DSL.name("temporary_measures"), SQLDataType.NUMERIC, this, "Тема обжалования временные меры");

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

    /**
     * The column <code>appeals.topic_appeal.registration_percent</code>. Тема
     * обжалования постановка на учет в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> REGISTRATION_PERCENT = createField(DSL.name("registration_percent"), SQLDataType.NUMERIC, this, "Тема обжалования постановка на учет в процентах");

    /**
     * The column <code>appeals.topic_appeal.sabpoena_percent</code>. Тема
     * обжалования повестки в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> SABPOENA_PERCENT = createField(DSL.name("sabpoena_percent"), SQLDataType.NUMERIC, this, "Тема обжалования повестки в процентах");

    /**
     * The column <code>appeals.topic_appeal.appear_percent</code>. Тема
     * обжалования явка в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> APPEAR_PERCENT = createField(DSL.name("appear_percent"), SQLDataType.NUMERIC, this, "Тема обжалования явка в процентах");

    /**
     * The column <code>appeals.topic_appeal.temporary_measures_percent</code>.
     * Тема обжалования временные меры в процентах
     */
    public final TableField<TopicAppealRecord, BigDecimal> TEMPORARY_MEASURES_PERCENT = createField(DSL.name("temporary_measures_percent"), SQLDataType.NUMERIC, this, "Тема обжалования временные меры в процентах");

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

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

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

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

    /**
     * Create an aliased <code>appeals.topic_appeal</code> table reference
     */
    public TopicAppeal(Name alias) {
        this(alias, TOPIC_APPEAL);
    }

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

    public <O extends Record> TopicAppeal(Table<O> path, ForeignKey<O, TopicAppealRecord> childPath, InverseForeignKey<O, TopicAppealRecord> parentPath) {
        super(path, childPath, parentPath, TOPIC_APPEAL);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<TopicAppealRecord> getPrimaryKey() {
        return Keys.PK_TOPIC_APPEAL;
    }

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

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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