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

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 PgRoles extends TableImpl<PgRolesRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_roles</code>
     */
    public static final PgRoles PG_ROLES = new PgRoles();

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

    /**
     * The column <code>pg_catalog.pg_roles.rolname</code>.
     */
    public final TableField<PgRolesRecord, String> ROLNAME = createField(DSL.name("rolname"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolsuper</code>.
     */
    public final TableField<PgRolesRecord, Boolean> ROLSUPER = createField(DSL.name("rolsuper"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolinherit</code>.
     */
    public final TableField<PgRolesRecord, Boolean> ROLINHERIT = createField(DSL.name("rolinherit"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolcreaterole</code>.
     */
    public final TableField<PgRolesRecord, Boolean> ROLCREATEROLE = createField(DSL.name("rolcreaterole"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolcreatedb</code>.
     */
    public final TableField<PgRolesRecord, Boolean> ROLCREATEDB = createField(DSL.name("rolcreatedb"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolcanlogin</code>.
     */
    public final TableField<PgRolesRecord, Boolean> ROLCANLOGIN = createField(DSL.name("rolcanlogin"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolreplication</code>.
     */
    public final TableField<PgRolesRecord, Boolean> ROLREPLICATION = createField(DSL.name("rolreplication"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolconnlimit</code>.
     */
    public final TableField<PgRolesRecord, Integer> ROLCONNLIMIT = createField(DSL.name("rolconnlimit"), SQLDataType.INTEGER, 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<PgRolesRecord, Object> ROLPROFILE = createField(DSL.name("rolprofile"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"regprofile\""), this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolloginattempts</code>.
     */
    public final TableField<PgRolesRecord, Integer> ROLLOGINATTEMPTS = createField(DSL.name("rolloginattempts"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rollastlogin</code>.
     */
    public final TableField<PgRolesRecord, Timestamp> ROLLASTLOGIN = createField(DSL.name("rollastlogin"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolfirstfailedauth</code>.
     */
    public final TableField<PgRolesRecord, Timestamp> ROLFIRSTFAILEDAUTH = createField(DSL.name("rolfirstfailedauth"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolstatus</code>.
     */
    public final TableField<PgRolesRecord, Short> ROLSTATUS = createField(DSL.name("rolstatus"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolpassword</code>.
     */
    public final TableField<PgRolesRecord, String> ROLPASSWORD = createField(DSL.name("rolpassword"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolvaliduntil</code>.
     */
    public final TableField<PgRolesRecord, Timestamp> ROLVALIDUNTIL = createField(DSL.name("rolvaliduntil"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolpasssetat</code>.
     */
    public final TableField<PgRolesRecord, Timestamp> ROLPASSSETAT = createField(DSL.name("rolpasssetat"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolbypassrls</code>.
     */
    public final TableField<PgRolesRecord, Boolean> ROLBYPASSRLS = createField(DSL.name("rolbypassrls"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_roles.rolconfig</code>.
     */
    public final TableField<PgRolesRecord, String[]> ROLCONFIG = createField(DSL.name("rolconfig"), SQLDataType.CLOB.array(), this, "");

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

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

    private PgRoles(Name alias, Table<PgRolesRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_roles" as  SELECT pg_authid.rolname,
         pg_authid.rolsuper,
         pg_authid.rolinherit,
         pg_authid.rolcreaterole,
         pg_authid.rolcreatedb,
         pg_authid.rolcanlogin,
         pg_authid.rolreplication,
         pg_authid.rolconnlimit,
         pg_authid.rolprofile,
         pg_authid.rolloginattempts,
         pg_authid.rollastlogin,
         pg_authid.rolfirstfailedauth,
         pg_authid.rolstatus,
         '********'::text AS rolpassword,
         pg_authid.rolvaliduntil,
         pg_authid.rolpasssetat,
         pg_authid.rolbypassrls,
         s.setconfig AS rolconfig,
         pg_authid.oid
        FROM (pg_authid
          LEFT JOIN pg_db_role_setting s ON (((pg_authid.oid = s.setrole) AND (s.setdatabase = (0)::oid))));
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_roles</code> table reference
     */
    public PgRoles(Name alias) {
        this(alias, PG_ROLES);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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