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

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 PgUser extends TableImpl<PgUserRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_user</code>
     */
    public static final PgUser PG_USER = new PgUser();

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

    /**
     * The column <code>pg_catalog.pg_user.usename</code>.
     */
    public final TableField<PgUserRecord, String> USENAME = createField(DSL.name("usename"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>pg_catalog.pg_user.usesysid</code>.
     */
    public final TableField<PgUserRecord, Long> USESYSID = createField(DSL.name("usesysid"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_user.usecreatedb</code>.
     */
    public final TableField<PgUserRecord, Boolean> USECREATEDB = createField(DSL.name("usecreatedb"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_user.usesuper</code>.
     */
    public final TableField<PgUserRecord, Boolean> USESUPER = createField(DSL.name("usesuper"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_user.userepl</code>.
     */
    public final TableField<PgUserRecord, Boolean> USEREPL = createField(DSL.name("userepl"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_user.usebypassrls</code>.
     */
    public final TableField<PgUserRecord, Boolean> USEBYPASSRLS = createField(DSL.name("usebypassrls"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_user.passwd</code>.
     */
    public final TableField<PgUserRecord, String> PASSWD = createField(DSL.name("passwd"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_user.valuntil</code>.
     */
    public final TableField<PgUserRecord, Timestamp> VALUNTIL = createField(DSL.name("valuntil"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_user.useconfig</code>.
     */
    public final TableField<PgUserRecord, String[]> USECONFIG = createField(DSL.name("useconfig"), SQLDataType.CLOB.array(), this, "");

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

    private PgUser(Name alias, Table<PgUserRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_user" as  SELECT pg_shadow.usename,
         pg_shadow.usesysid,
         pg_shadow.usecreatedb,
         pg_shadow.usesuper,
         pg_shadow.userepl,
         pg_shadow.usebypassrls,
         '********'::text AS passwd,
         pg_shadow.valuntil,
         pg_shadow.useconfig
        FROM pg_shadow;
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_user</code> table reference
     */
    public PgUser(Name alias) {
        this(alias, PG_USER);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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