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

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 PgStatDatabaseConflicts extends TableImpl<PgStatDatabaseConflictsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>pg_catalog.pg_stat_database_conflicts</code>
     */
    public static final PgStatDatabaseConflicts PG_STAT_DATABASE_CONFLICTS = new PgStatDatabaseConflicts();

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

    /**
     * The column <code>pg_catalog.pg_stat_database_conflicts.datid</code>.
     */
    public final TableField<PgStatDatabaseConflictsRecord, Long> DATID = createField(DSL.name("datid"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_database_conflicts.datname</code>.
     */
    public final TableField<PgStatDatabaseConflictsRecord, String> DATNAME = createField(DSL.name("datname"), SQLDataType.VARCHAR, this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_database_conflicts.confl_tablespace</code>.
     */
    public final TableField<PgStatDatabaseConflictsRecord, Long> CONFL_TABLESPACE = createField(DSL.name("confl_tablespace"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_database_conflicts.confl_lock</code>.
     */
    public final TableField<PgStatDatabaseConflictsRecord, Long> CONFL_LOCK = createField(DSL.name("confl_lock"), SQLDataType.BIGINT, this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_database_conflicts.confl_snapshot</code>.
     */
    public final TableField<PgStatDatabaseConflictsRecord, Long> CONFL_SNAPSHOT = createField(DSL.name("confl_snapshot"), SQLDataType.BIGINT, this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_database_conflicts.confl_bufferpin</code>.
     */
    public final TableField<PgStatDatabaseConflictsRecord, Long> CONFL_BUFFERPIN = createField(DSL.name("confl_bufferpin"), SQLDataType.BIGINT, this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_database_conflicts.confl_deadlock</code>.
     */
    public final TableField<PgStatDatabaseConflictsRecord, Long> CONFL_DEADLOCK = createField(DSL.name("confl_deadlock"), SQLDataType.BIGINT, this, "");

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

    private PgStatDatabaseConflicts(Name alias, Table<PgStatDatabaseConflictsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_stat_database_conflicts" as  SELECT d.oid AS datid,
         d.datname,
         pg_stat_get_db_conflict_tablespace(d.oid) AS confl_tablespace,
         pg_stat_get_db_conflict_lock(d.oid) AS confl_lock,
         pg_stat_get_db_conflict_snapshot(d.oid) AS confl_snapshot,
         pg_stat_get_db_conflict_bufferpin(d.oid) AS confl_bufferpin,
         pg_stat_get_db_conflict_startup_deadlock(d.oid) AS confl_deadlock
        FROM pg_database d;
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_stat_database_conflicts</code>
     * table reference
     */
    public PgStatDatabaseConflicts(Name alias) {
        this(alias, PG_STAT_DATABASE_CONFLICTS);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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