/*
 * This file is generated by jOOQ.
 */
package ervu_secret.ervu_secret.db_beans.pg_catalog.tables;


import ervu_secret.ervu_secret.db_beans.pg_catalog.Keys;
import ervu_secret.ervu_secret.db_beans.pg_catalog.PgCatalog;
import ervu_secret.ervu_secret.db_beans.pg_catalog.tables.records.PgRangeRecord;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.jooq.Condition;
import org.jooq.Field;
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;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgRange extends TableImpl<PgRangeRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_range</code>
     */
    public static final PgRange PG_RANGE = new PgRange();

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

    /**
     * The column <code>pg_catalog.pg_range.rngtypid</code>.
     */
    public final TableField<PgRangeRecord, Long> RNGTYPID = createField(DSL.name("rngtypid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_range.rngsubtype</code>.
     */
    public final TableField<PgRangeRecord, Long> RNGSUBTYPE = createField(DSL.name("rngsubtype"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_range.rngmultitypid</code>.
     */
    public final TableField<PgRangeRecord, Long> RNGMULTITYPID = createField(DSL.name("rngmultitypid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_range.rngcollation</code>.
     */
    public final TableField<PgRangeRecord, Long> RNGCOLLATION = createField(DSL.name("rngcollation"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_range.rngsubopc</code>.
     */
    public final TableField<PgRangeRecord, Long> RNGSUBOPC = createField(DSL.name("rngsubopc"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_range.rngcanonical</code>.
     */
    public final TableField<PgRangeRecord, String> RNGCANONICAL = createField(DSL.name("rngcanonical"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_range.rngsubdiff</code>.
     */
    public final TableField<PgRangeRecord, String> RNGSUBDIFF = createField(DSL.name("rngsubdiff"), SQLDataType.VARCHAR.nullable(false), this, "");

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

    private PgRange(Name alias, Table<PgRangeRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>pg_catalog.pg_range</code> table reference
     */
    public PgRange(String alias) {
        this(DSL.name(alias), PG_RANGE);
    }

    /**
     * Create an aliased <code>pg_catalog.pg_range</code> table reference
     */
    public PgRange(Name alias) {
        this(alias, PG_RANGE);
    }

    /**
     * Create a <code>pg_catalog.pg_range</code> table reference
     */
    public PgRange() {
        this(DSL.name("pg_range"), null);
    }

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

    @Override
    public UniqueKey<PgRangeRecord> getPrimaryKey() {
        return Keys.PG_RANGE_RNGTYPID_INDEX;
    }

    @Override
    public List<UniqueKey<PgRangeRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.PG_RANGE_RNGMULTITYPID_INDEX);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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