/*
 * 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.ForeignTablesRecord;

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 ForeignTables extends TableImpl<ForeignTablesRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>information_schema.foreign_tables</code>
     */
    public static final ForeignTables FOREIGN_TABLES = new ForeignTables();

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

    /**
     * The column
     * <code>information_schema.foreign_tables.foreign_table_catalog</code>.
     */
    public final TableField<ForeignTablesRecord, String> FOREIGN_TABLE_CATALOG = createField(DSL.name("foreign_table_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_tables.foreign_table_schema</code>.
     */
    public final TableField<ForeignTablesRecord, String> FOREIGN_TABLE_SCHEMA = createField(DSL.name("foreign_table_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.foreign_tables.foreign_table_name</code>.
     */
    public final TableField<ForeignTablesRecord, String> FOREIGN_TABLE_NAME = createField(DSL.name("foreign_table_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

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

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

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

    private ForeignTables(Name alias, Table<ForeignTablesRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "foreign_tables" as  SELECT _pg_foreign_tables.foreign_table_catalog,
         _pg_foreign_tables.foreign_table_schema,
         _pg_foreign_tables.foreign_table_name,
         _pg_foreign_tables.foreign_server_catalog,
         _pg_foreign_tables.foreign_server_name
        FROM information_schema._pg_foreign_tables;
        """), where);
    }

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

    /**
     * Create an aliased <code>information_schema.foreign_tables</code> table
     * reference
     */
    public ForeignTables(Name alias) {
        this(alias, FOREIGN_TABLES);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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