/*
 * 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.ReviewRatingRecord;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;
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 ReviewRating extends TableImpl<ReviewRatingRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>appeals.review_rating</code>
     */
    public static final ReviewRating REVIEW_RATING = new ReviewRating();

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

    /**
     * The column <code>appeals.review_rating.id_review_rating</code>.
     */
    public final TableField<ReviewRatingRecord, Long> ID_REVIEW_RATING = createField(DSL.name("id_review_rating"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>appeals.review_rating.speed</code>. Скорость
     * рассмотрения
     */
    public final TableField<ReviewRatingRecord, BigDecimal> SPEED = createField(DSL.name("speed"), SQLDataType.NUMERIC, this, "Скорость рассмотрения");

    /**
     * The column <code>appeals.review_rating.rating</code>. Оценка
     * удовлетворенности
     */
    public final TableField<ReviewRatingRecord, BigDecimal> RATING = createField(DSL.name("rating"), SQLDataType.NUMERIC, this, "Оценка удовлетворенности");

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

    /**
     * The column <code>appeals.review_rating.id_region</code>.
     */
    public final TableField<ReviewRatingRecord, Long> ID_REGION = createField(DSL.name("id_region"), SQLDataType.BIGINT, this, "");

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

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

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

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

    /**
     * Create an aliased <code>appeals.review_rating</code> table reference
     */
    public ReviewRating(Name alias) {
        this(alias, REVIEW_RATING);
    }

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

    public <O extends Record> ReviewRating(Table<O> path, ForeignKey<O, ReviewRatingRecord> childPath, InverseForeignKey<O, ReviewRatingRecord> parentPath) {
        super(path, childPath, parentPath, REVIEW_RATING);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<ReviewRatingRecord> getPrimaryKey() {
        return Keys.PK_REVIEW_RATING;
    }

    @Override
    public List<ForeignKey<ReviewRatingRecord, ?>> getReferences() {
        return Arrays.asList(Keys.REVIEW_RATING__FK_REGION, Keys.REVIEW_RATING__REVIEW_RATING_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.REVIEW_RATING__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.REVIEW_RATING__REVIEW_RATING_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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