/*
 * 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.PgCatalog;
import ervu_secret.ervu_secret.db_beans.pg_catalog.tables.records.PgStatGssapiRecord;

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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_stat_gssapi</code>
     */
    public static final PgStatGssapi PG_STAT_GSSAPI = new PgStatGssapi();

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

    /**
     * The column <code>pg_catalog.pg_stat_gssapi.pid</code>.
     */
    public final TableField<PgStatGssapiRecord, Integer> PID = createField(DSL.name("pid"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_gssapi.gss_authenticated</code>.
     */
    public final TableField<PgStatGssapiRecord, Boolean> GSS_AUTHENTICATED = createField(DSL.name("gss_authenticated"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_gssapi.principal</code>.
     */
    public final TableField<PgStatGssapiRecord, String> PRINCIPAL = createField(DSL.name("principal"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_gssapi.encrypted</code>.
     */
    public final TableField<PgStatGssapiRecord, Boolean> ENCRYPTED = createField(DSL.name("encrypted"), SQLDataType.BOOLEAN, this, "");

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

    private PgStatGssapi(Name alias, Table<PgStatGssapiRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_stat_gssapi" as  SELECT s.pid,
          s.gss_auth AS gss_authenticated,
          s.gss_princ AS principal,
          s.gss_enc AS encrypted
         FROM pg_stat_get_activity(NULL::integer) s(datid, pid, usesysid, application_name, state, query, wait_event_type, wait_event, xact_start, query_start, backend_start, state_change, client_addr, client_hostname, client_port, backend_xid, backend_xmin, backend_type, ssl, sslversion, sslcipher, sslbits, ssl_client_dn, ssl_client_serial, ssl_issuer_dn, gss_auth, gss_princ, gss_enc, leader_pid, query_id)
        WHERE (s.client_port IS NOT NULL);
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_stat_gssapi</code> table reference
     */
    public PgStatGssapi(Name alias) {
        this(alias, PG_STAT_GSSAPI);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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