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

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

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.UniqueKey;
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 PgTrigger extends TableImpl<PgTriggerRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_trigger</code>
     */
    public static final PgTrigger PG_TRIGGER = new PgTrigger();

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

    /**
     * The column <code>pg_catalog.pg_trigger.oid</code>.
     */
    public final TableField<PgTriggerRecord, Long> OID = createField(DSL.name("oid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgrelid</code>.
     */
    public final TableField<PgTriggerRecord, Long> TGRELID = createField(DSL.name("tgrelid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgparentid</code>.
     */
    public final TableField<PgTriggerRecord, Long> TGPARENTID = createField(DSL.name("tgparentid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgname</code>.
     */
    public final TableField<PgTriggerRecord, String> TGNAME = createField(DSL.name("tgname"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgfoid</code>.
     */
    public final TableField<PgTriggerRecord, Long> TGFOID = createField(DSL.name("tgfoid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgtype</code>.
     */
    public final TableField<PgTriggerRecord, Short> TGTYPE = createField(DSL.name("tgtype"), SQLDataType.SMALLINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgenabled</code>.
     */
    public final TableField<PgTriggerRecord, String> TGENABLED = createField(DSL.name("tgenabled"), SQLDataType.CHAR.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgisinternal</code>.
     */
    public final TableField<PgTriggerRecord, Boolean> TGISINTERNAL = createField(DSL.name("tgisinternal"), SQLDataType.BOOLEAN.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgconstrrelid</code>.
     */
    public final TableField<PgTriggerRecord, Long> TGCONSTRRELID = createField(DSL.name("tgconstrrelid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgconstrindid</code>.
     */
    public final TableField<PgTriggerRecord, Long> TGCONSTRINDID = createField(DSL.name("tgconstrindid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgconstraint</code>.
     */
    public final TableField<PgTriggerRecord, Long> TGCONSTRAINT = createField(DSL.name("tgconstraint"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgdeferrable</code>.
     */
    public final TableField<PgTriggerRecord, Boolean> TGDEFERRABLE = createField(DSL.name("tgdeferrable"), SQLDataType.BOOLEAN.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tginitdeferred</code>.
     */
    public final TableField<PgTriggerRecord, Boolean> TGINITDEFERRED = createField(DSL.name("tginitdeferred"), SQLDataType.BOOLEAN.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgnargs</code>.
     */
    public final TableField<PgTriggerRecord, Short> TGNARGS = createField(DSL.name("tgnargs"), SQLDataType.SMALLINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgattr</code>.
     */
    public final TableField<PgTriggerRecord, Object[]> TGATTR = createField(DSL.name("tgattr"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"nt2vector\"").nullable(false).array(), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgargs</code>.
     */
    public final TableField<PgTriggerRecord, byte[]> TGARGS = createField(DSL.name("tgargs"), SQLDataType.BLOB.nullable(false), 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<PgTriggerRecord, Object> TGQUAL = createField(DSL.name("tgqual"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"pg_node_tree\""), this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgoldtable</code>.
     */
    public final TableField<PgTriggerRecord, String> TGOLDTABLE = createField(DSL.name("tgoldtable"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>pg_catalog.pg_trigger.tgnewtable</code>.
     */
    public final TableField<PgTriggerRecord, String> TGNEWTABLE = createField(DSL.name("tgnewtable"), SQLDataType.VARCHAR, this, "");

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

    private PgTrigger(Name alias, Table<PgTriggerRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_trigger</code> table reference
     */
    public PgTrigger(Name alias) {
        this(alias, PG_TRIGGER);
    }

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

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

    @Override
    public UniqueKey<PgTriggerRecord> getPrimaryKey() {
        return Keys.PG_TRIGGER_OID_INDEX;
    }

    @Override
    public List<UniqueKey<PgTriggerRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.PG_TRIGGER_TGRELID_TGNAME_INDEX);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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