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


import ervu_dashboard.ervu_dashboard.db_beans.appeals.tables.ReviewRating.ReviewRatingPath;
import ervu_dashboard.ervu_dashboard.db_beans.ratings.tables.AppearSubppoena.AppearSubppoenaPath;
import ervu_dashboard.ervu_dashboard.db_beans.ratings.tables.ConsiderationComplaint.ConsiderationComplaintPath;
import ervu_dashboard.ervu_dashboard.db_beans.ratings.tables.Recruitment.RecruitmentPath;
import ervu_dashboard.ervu_dashboard.db_beans.space.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.space.Space;
import ervu_dashboard.ervu_dashboard.db_beans.space.tables.records.RegionRecord;

import java.util.Collection;

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 Region extends TableImpl<RegionRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>space.region</code>
     */
    public static final Region REGION = new Region();

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

    /**
     * The column <code>space.region.id_region</code>.
     */
    public final TableField<RegionRecord, Long> ID_REGION = createField(DSL.name("id_region"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>space.region.region</code>. Наименование региона
     */
    public final TableField<RegionRecord, String> REGION_ = createField(DSL.name("region"), SQLDataType.CLOB, this, "Наименование региона");

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

    private Region(Name alias, Table<RegionRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Регионы"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>space.region</code> table reference
     */
    public Region(String alias) {
        this(DSL.name(alias), REGION);
    }

    /**
     * Create an aliased <code>space.region</code> table reference
     */
    public Region(Name alias) {
        this(alias, REGION);
    }

    /**
     * Create a <code>space.region</code> table reference
     */
    public Region() {
        this(DSL.name("region"), null);
    }

    public <O extends Record> Region(Table<O> path, ForeignKey<O, RegionRecord> childPath, InverseForeignKey<O, RegionRecord> parentPath) {
        super(path, childPath, parentPath, REGION);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<RegionRecord> getPrimaryKey() {
        return Keys.PK_REGION;
    }

    private transient ReviewRatingPath _reviewRating;

    /**
     * Get the implicit to-many join path to the
     * <code>appeals.review_rating</code> table
     */
    public ReviewRatingPath reviewRating() {
        if (_reviewRating == null)
            _reviewRating = new ReviewRatingPath(this, null, ervu_dashboard.ervu_dashboard.db_beans.appeals.Keys.REVIEW_RATING__FK_REGION.getInverseKey());

        return _reviewRating;
    }

    private transient AppearSubppoenaPath _appearSubppoena;

    /**
     * Get the implicit to-many join path to the
     * <code>ratings.appear_subppoena</code> table
     */
    public AppearSubppoenaPath appearSubppoena() {
        if (_appearSubppoena == null)
            _appearSubppoena = new AppearSubppoenaPath(this, null, ervu_dashboard.ervu_dashboard.db_beans.ratings.Keys.APPEAR_SUBPPOENA__FK_REGION.getInverseKey());

        return _appearSubppoena;
    }

    private transient ConsiderationComplaintPath _considerationComplaint;

    /**
     * Get the implicit to-many join path to the
     * <code>ratings.consideration_complaint</code> table
     */
    public ConsiderationComplaintPath considerationComplaint() {
        if (_considerationComplaint == null)
            _considerationComplaint = new ConsiderationComplaintPath(this, null, ervu_dashboard.ervu_dashboard.db_beans.ratings.Keys.CONSIDERATION_COMPLAINT__FK_REGION.getInverseKey());

        return _considerationComplaint;
    }

    private transient RecruitmentPath _recruitment;

    /**
     * Get the implicit to-many join path to the
     * <code>ratings.recruitment</code> table
     */
    public RecruitmentPath recruitment() {
        if (_recruitment == null)
            _recruitment = new RecruitmentPath(this, null, ervu_dashboard.ervu_dashboard.db_beans.ratings.Keys.RECRUITMENT__FK_REGION.getInverseKey());

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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