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


import java.util.Collection;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
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;

import ru.micord.ervu_dashboard.db_beans.space.Keys;
import ru.micord.ervu_dashboard.db_beans.space.Space;
import ru.micord.ervu_dashboard.db_beans.space.tables.records.RegionRecord;


/**
 * Регионы
 */
@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);
    }

    @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;
    }

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