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


import ervu_secret.ervu_secret.db_beans.information_schema.Domains;
import ervu_secret.ervu_secret.db_beans.information_schema.InformationSchema;
import ervu_secret.ervu_secret.db_beans.information_schema.tables.records.ForeignServersRecord;

import java.util.Collection;

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.impl.DSL;
import org.jooq.impl.TableImpl;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>information_schema.foreign_servers</code>
     */
    public static final ForeignServers FOREIGN_SERVERS = new ForeignServers();

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

    /**
     * The column
     * <code>information_schema.foreign_servers.foreign_server_catalog</code>.
     */
    public final TableField<ForeignServersRecord, String> FOREIGN_SERVER_CATALOG = createField(DSL.name("foreign_server_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_servers.foreign_server_name</code>.
     */
    public final TableField<ForeignServersRecord, String> FOREIGN_SERVER_NAME = createField(DSL.name("foreign_server_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_servers.foreign_data_wrapper_catalog</code>.
     */
    public final TableField<ForeignServersRecord, String> FOREIGN_DATA_WRAPPER_CATALOG = createField(DSL.name("foreign_data_wrapper_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_servers.foreign_data_wrapper_name</code>.
     */
    public final TableField<ForeignServersRecord, String> FOREIGN_DATA_WRAPPER_NAME = createField(DSL.name("foreign_data_wrapper_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_servers.foreign_server_type</code>.
     */
    public final TableField<ForeignServersRecord, String> FOREIGN_SERVER_TYPE = createField(DSL.name("foreign_server_type"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_servers.foreign_server_version</code>.
     */
    public final TableField<ForeignServersRecord, String> FOREIGN_SERVER_VERSION = createField(DSL.name("foreign_server_version"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_servers.authorization_identifier</code>.
     */
    public final TableField<ForeignServersRecord, String> AUTHORIZATION_IDENTIFIER = createField(DSL.name("authorization_identifier"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

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

    private ForeignServers(Name alias, Table<ForeignServersRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "foreign_servers" as  SELECT _pg_foreign_servers.foreign_server_catalog,
         _pg_foreign_servers.foreign_server_name,
         _pg_foreign_servers.foreign_data_wrapper_catalog,
         _pg_foreign_servers.foreign_data_wrapper_name,
         _pg_foreign_servers.foreign_server_type,
         _pg_foreign_servers.foreign_server_version,
         _pg_foreign_servers.authorization_identifier
        FROM information_schema._pg_foreign_servers;
        """), where);
    }

    /**
     * Create an aliased <code>information_schema.foreign_servers</code> table
     * reference
     */
    public ForeignServers(String alias) {
        this(DSL.name(alias), FOREIGN_SERVERS);
    }

    /**
     * Create an aliased <code>information_schema.foreign_servers</code> table
     * reference
     */
    public ForeignServers(Name alias) {
        this(alias, FOREIGN_SERVERS);
    }

    /**
     * Create a <code>information_schema.foreign_servers</code> table reference
     */
    public ForeignServers() {
        this(DSL.name("foreign_servers"), null);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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