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

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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_prepared_xacts</code>
     */
    public static final PgPreparedXacts PG_PREPARED_XACTS = new PgPreparedXacts();

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

    /**
     * The column <code>pg_catalog.pg_prepared_xacts.transaction</code>.
     */
    public final TableField<PgPreparedXactsRecord, Long> TRANSACTION = createField(DSL.name("transaction"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_xacts.gid</code>.
     */
    public final TableField<PgPreparedXactsRecord, String> GID = createField(DSL.name("gid"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_xacts.prepared</code>.
     */
    public final TableField<PgPreparedXactsRecord, Timestamp> PREPARED = createField(DSL.name("prepared"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_xacts.owner</code>.
     */
    public final TableField<PgPreparedXactsRecord, String> OWNER = createField(DSL.name("owner"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_xacts.database</code>.
     */
    public final TableField<PgPreparedXactsRecord, String> DATABASE = createField(DSL.name("database"), SQLDataType.VARCHAR, this, "");

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

    private PgPreparedXacts(Name alias, Table<PgPreparedXactsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_prepared_xacts" as  SELECT p.transaction,
         p.gid,
         p.prepared,
         u.rolname AS owner,
         d.datname AS database
        FROM ((pg_prepared_xact() p(transaction, gid, prepared, ownerid, dbid)
          LEFT JOIN pg_authid u ON ((p.ownerid = u.oid)))
          LEFT JOIN pg_database d ON ((p.dbid = d.oid)));
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_prepared_xacts</code> table
     * reference
     */
    public PgPreparedXacts(Name alias) {
        this(alias, PG_PREPARED_XACTS);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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