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

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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_stat_subscription</code>
     */
    public static final PgStatSubscription PG_STAT_SUBSCRIPTION = new PgStatSubscription();

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

    /**
     * The column <code>pg_catalog.pg_stat_subscription.subid</code>.
     */
    public final TableField<PgStatSubscriptionRecord, Long> SUBID = createField(DSL.name("subid"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_subscription.subname</code>.
     */
    public final TableField<PgStatSubscriptionRecord, String> SUBNAME = createField(DSL.name("subname"), SQLDataType.VARCHAR, this, "");

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

    /**
     * The column <code>pg_catalog.pg_stat_subscription.relid</code>.
     */
    public final TableField<PgStatSubscriptionRecord, Long> RELID = createField(DSL.name("relid"), SQLDataType.BIGINT, this, "");

    /**
     * @deprecated Unknown data type. If this is a qualified, user-defined type,
     * it may have been excluded from code generation. If this is a built-in
     * type, you can define an explicit {@link org.jooq.Binding} to specify how
     * this type should be handled. Deprecation can be turned off using
     * {@literal <deprecationOnUnknownTypes/>} in your code generator
     * configuration.
     */
    @Deprecated
    public final TableField<PgStatSubscriptionRecord, Object> RECEIVED_LSN = createField(DSL.name("received_lsn"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"pg_lsn\""), this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_subscription.last_msg_send_time</code>.
     */
    public final TableField<PgStatSubscriptionRecord, Timestamp> LAST_MSG_SEND_TIME = createField(DSL.name("last_msg_send_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_subscription.last_msg_receipt_time</code>.
     */
    public final TableField<PgStatSubscriptionRecord, Timestamp> LAST_MSG_RECEIPT_TIME = createField(DSL.name("last_msg_receipt_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * @deprecated Unknown data type. If this is a qualified, user-defined type,
     * it may have been excluded from code generation. If this is a built-in
     * type, you can define an explicit {@link org.jooq.Binding} to specify how
     * this type should be handled. Deprecation can be turned off using
     * {@literal <deprecationOnUnknownTypes/>} in your code generator
     * configuration.
     */
    @Deprecated
    public final TableField<PgStatSubscriptionRecord, Object> LATEST_END_LSN = createField(DSL.name("latest_end_lsn"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"pg_lsn\""), this, "");

    /**
     * The column <code>pg_catalog.pg_stat_subscription.latest_end_time</code>.
     */
    public final TableField<PgStatSubscriptionRecord, Timestamp> LATEST_END_TIME = createField(DSL.name("latest_end_time"), SQLDataType.TIMESTAMP(0), this, "");

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

    private PgStatSubscription(Name alias, Table<PgStatSubscriptionRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_stat_subscription" as  SELECT su.oid AS subid,
         su.subname,
         st.pid,
         st.relid,
         st.received_lsn,
         st.last_msg_send_time,
         st.last_msg_receipt_time,
         st.latest_end_lsn,
         st.latest_end_time
        FROM (pg_subscription su
          LEFT JOIN pg_stat_get_subscription(NULL::oid) st(subid, relid, pid, received_lsn, last_msg_send_time, last_msg_receipt_time, latest_end_lsn, latest_end_time) ON ((st.subid = su.oid)));
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_stat_subscription</code> table
     * reference
     */
    public PgStatSubscription(Name alias) {
        this(alias, PG_STAT_SUBSCRIPTION);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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