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

import java.math.BigDecimal;
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 PgStatSsl extends TableImpl<PgStatSslRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_stat_ssl</code>
     */
    public static final PgStatSsl PG_STAT_SSL = new PgStatSsl();

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

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

    /**
     * The column <code>pg_catalog.pg_stat_ssl.ssl</code>.
     */
    public final TableField<PgStatSslRecord, Boolean> SSL = createField(DSL.name("ssl"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_ssl.version</code>.
     */
    public final TableField<PgStatSslRecord, String> VERSION = createField(DSL.name("version"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_ssl.cipher</code>.
     */
    public final TableField<PgStatSslRecord, String> CIPHER = createField(DSL.name("cipher"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_ssl.bits</code>.
     */
    public final TableField<PgStatSslRecord, Integer> BITS = createField(DSL.name("bits"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_ssl.client_dn</code>.
     */
    public final TableField<PgStatSslRecord, String> CLIENT_DN = createField(DSL.name("client_dn"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_ssl.client_serial</code>.
     */
    public final TableField<PgStatSslRecord, BigDecimal> CLIENT_SERIAL = createField(DSL.name("client_serial"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_ssl.issuer_dn</code>.
     */
    public final TableField<PgStatSslRecord, String> ISSUER_DN = createField(DSL.name("issuer_dn"), SQLDataType.CLOB, this, "");

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

    private PgStatSsl(Name alias, Table<PgStatSslRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_stat_ssl" as  SELECT s.pid,
          s.ssl,
          s.sslversion AS version,
          s.sslcipher AS cipher,
          s.sslbits AS bits,
          s.ssl_client_dn AS client_dn,
          s.ssl_client_serial AS client_serial,
          s.ssl_issuer_dn AS issuer_dn
         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_ssl</code> table reference
     */
    public PgStatSsl(String alias) {
        this(DSL.name(alias), PG_STAT_SSL);
    }

    /**
     * Create an aliased <code>pg_catalog.pg_stat_ssl</code> table reference
     */
    public PgStatSsl(Name alias) {
        this(alias, PG_STAT_SSL);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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