/*
 * This file is generated by jOOQ.
 */
package ervu_secret.ervu_secret.db_beans.information_schema.tables;


import ervu_secret.ervu_secret.db_beans.information_schema.Domains;
import ervu_secret.ervu_secret.db_beans.information_schema.InformationSchema;
import ervu_secret.ervu_secret.db_beans.information_schema.tables.records.ParametersRecord;

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.TableImpl;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>information_schema.parameters</code>
     */
    public static final Parameters PARAMETERS = new Parameters();

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

    /**
     * The column <code>information_schema.parameters.specific_catalog</code>.
     */
    public final TableField<ParametersRecord, String> SPECIFIC_CATALOG = createField(DSL.name("specific_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.specific_schema</code>.
     */
    public final TableField<ParametersRecord, String> SPECIFIC_SCHEMA = createField(DSL.name("specific_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.specific_name</code>.
     */
    public final TableField<ParametersRecord, String> SPECIFIC_NAME = createField(DSL.name("specific_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.ordinal_position</code>.
     */
    public final TableField<ParametersRecord, Integer> ORDINAL_POSITION = createField(DSL.name("ordinal_position"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.parameter_mode</code>.
     */
    public final TableField<ParametersRecord, String> PARAMETER_MODE = createField(DSL.name("parameter_mode"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.is_result</code>.
     */
    public final TableField<ParametersRecord, String> IS_RESULT = createField(DSL.name("is_result"), Domains.YES_OR_NO.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.as_locator</code>.
     */
    public final TableField<ParametersRecord, String> AS_LOCATOR = createField(DSL.name("as_locator"), Domains.YES_OR_NO.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.parameter_name</code>.
     */
    public final TableField<ParametersRecord, String> PARAMETER_NAME = createField(DSL.name("parameter_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.data_type</code>.
     */
    public final TableField<ParametersRecord, String> DATA_TYPE = createField(DSL.name("data_type"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.parameters.character_maximum_length</code>.
     */
    public final TableField<ParametersRecord, Integer> CHARACTER_MAXIMUM_LENGTH = createField(DSL.name("character_maximum_length"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.parameters.character_octet_length</code>.
     */
    public final TableField<ParametersRecord, Integer> CHARACTER_OCTET_LENGTH = createField(DSL.name("character_octet_length"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.parameters.character_set_catalog</code>.
     */
    public final TableField<ParametersRecord, String> CHARACTER_SET_CATALOG = createField(DSL.name("character_set_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.parameters.character_set_schema</code>.
     */
    public final TableField<ParametersRecord, String> CHARACTER_SET_SCHEMA = createField(DSL.name("character_set_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.character_set_name</code>.
     */
    public final TableField<ParametersRecord, String> CHARACTER_SET_NAME = createField(DSL.name("character_set_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.collation_catalog</code>.
     */
    public final TableField<ParametersRecord, String> COLLATION_CATALOG = createField(DSL.name("collation_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.collation_schema</code>.
     */
    public final TableField<ParametersRecord, String> COLLATION_SCHEMA = createField(DSL.name("collation_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.collation_name</code>.
     */
    public final TableField<ParametersRecord, String> COLLATION_NAME = createField(DSL.name("collation_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.numeric_precision</code>.
     */
    public final TableField<ParametersRecord, Integer> NUMERIC_PRECISION = createField(DSL.name("numeric_precision"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.parameters.numeric_precision_radix</code>.
     */
    public final TableField<ParametersRecord, Integer> NUMERIC_PRECISION_RADIX = createField(DSL.name("numeric_precision_radix"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.numeric_scale</code>.
     */
    public final TableField<ParametersRecord, Integer> NUMERIC_SCALE = createField(DSL.name("numeric_scale"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.datetime_precision</code>.
     */
    public final TableField<ParametersRecord, Integer> DATETIME_PRECISION = createField(DSL.name("datetime_precision"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.interval_type</code>.
     */
    public final TableField<ParametersRecord, String> INTERVAL_TYPE = createField(DSL.name("interval_type"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.interval_precision</code>.
     */
    public final TableField<ParametersRecord, Integer> INTERVAL_PRECISION = createField(DSL.name("interval_precision"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.udt_catalog</code>.
     */
    public final TableField<ParametersRecord, String> UDT_CATALOG = createField(DSL.name("udt_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.udt_schema</code>.
     */
    public final TableField<ParametersRecord, String> UDT_SCHEMA = createField(DSL.name("udt_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.udt_name</code>.
     */
    public final TableField<ParametersRecord, String> UDT_NAME = createField(DSL.name("udt_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.scope_catalog</code>.
     */
    public final TableField<ParametersRecord, String> SCOPE_CATALOG = createField(DSL.name("scope_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.scope_schema</code>.
     */
    public final TableField<ParametersRecord, String> SCOPE_SCHEMA = createField(DSL.name("scope_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.scope_name</code>.
     */
    public final TableField<ParametersRecord, String> SCOPE_NAME = createField(DSL.name("scope_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.parameters.maximum_cardinality</code>.
     */
    public final TableField<ParametersRecord, Integer> MAXIMUM_CARDINALITY = createField(DSL.name("maximum_cardinality"), Domains.CARDINAL_NUMBER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.dtd_identifier</code>.
     */
    public final TableField<ParametersRecord, String> DTD_IDENTIFIER = createField(DSL.name("dtd_identifier"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column <code>information_schema.parameters.parameter_default</code>.
     */
    public final TableField<ParametersRecord, String> PARAMETER_DEFAULT = createField(DSL.name("parameter_default"), Domains.CHARACTER_DATA.getDataType(), this, "");

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

    private Parameters(Name alias, Table<ParametersRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "parameters" as  SELECT (current_database())::information_schema.sql_identifier AS specific_catalog,
          (ss.n_nspname)::information_schema.sql_identifier AS specific_schema,
          (nameconcatoid(ss.proname, ss.p_oid))::information_schema.sql_identifier AS specific_name,
          ((ss.x).n)::information_schema.cardinal_number AS ordinal_position,
          (
              CASE
                  WHEN (ss.proargmodes IS NULL) THEN 'IN'::text
                  WHEN (ss.proargmodes[(ss.x).n] = 'i'::"char") THEN 'IN'::text
                  WHEN (ss.proargmodes[(ss.x).n] = 'o'::"char") THEN 'OUT'::text
                  WHEN (ss.proargmodes[(ss.x).n] = 'b'::"char") THEN 'INOUT'::text
                  WHEN (ss.proargmodes[(ss.x).n] = 'v'::"char") THEN 'IN'::text
                  WHEN (ss.proargmodes[(ss.x).n] = 't'::"char") THEN 'OUT'::text
                  ELSE NULL::text
              END)::information_schema.character_data AS parameter_mode,
          ('NO'::character varying)::information_schema.yes_or_no AS is_result,
          ('NO'::character varying)::information_schema.yes_or_no AS as_locator,
          (NULLIF(ss.proargnames[(ss.x).n], ''::text))::information_schema.sql_identifier AS parameter_name,
          (
              CASE
                  WHEN ((t.typelem <> (0)::oid) AND (t.typlen = '-1'::integer)) THEN 'ARRAY'::text
                  WHEN (nt.nspname = 'pg_catalog'::name) THEN format_type(t.oid, NULL::integer)
                  ELSE 'USER-DEFINED'::text
              END)::information_schema.character_data AS data_type,
          (NULL::integer)::information_schema.cardinal_number AS character_maximum_length,
          (NULL::integer)::information_schema.cardinal_number AS character_octet_length,
          (NULL::name)::information_schema.sql_identifier AS character_set_catalog,
          (NULL::name)::information_schema.sql_identifier AS character_set_schema,
          (NULL::name)::information_schema.sql_identifier AS character_set_name,
          (NULL::name)::information_schema.sql_identifier AS collation_catalog,
          (NULL::name)::information_schema.sql_identifier AS collation_schema,
          (NULL::name)::information_schema.sql_identifier AS collation_name,
          (NULL::integer)::information_schema.cardinal_number AS numeric_precision,
          (NULL::integer)::information_schema.cardinal_number AS numeric_precision_radix,
          (NULL::integer)::information_schema.cardinal_number AS numeric_scale,
          (NULL::integer)::information_schema.cardinal_number AS datetime_precision,
          (NULL::character varying)::information_schema.character_data AS interval_type,
          (NULL::integer)::information_schema.cardinal_number AS interval_precision,
          (current_database())::information_schema.sql_identifier AS udt_catalog,
          (nt.nspname)::information_schema.sql_identifier AS udt_schema,
          (t.typname)::information_schema.sql_identifier AS udt_name,
          (NULL::name)::information_schema.sql_identifier AS scope_catalog,
          (NULL::name)::information_schema.sql_identifier AS scope_schema,
          (NULL::name)::information_schema.sql_identifier AS scope_name,
          (NULL::integer)::information_schema.cardinal_number AS maximum_cardinality,
          ((ss.x).n)::information_schema.sql_identifier AS dtd_identifier,
          (
              CASE
                  WHEN pg_has_role(ss.proowner, 'USAGE'::text) THEN pg_get_function_arg_default(ss.p_oid, (ss.x).n)
                  ELSE NULL::text
              END)::information_schema.character_data AS parameter_default
         FROM pg_type t,
          pg_namespace nt,
          ( SELECT n.nspname AS n_nspname,
                  p.proname,
                  p.oid AS p_oid,
                  p.proowner,
                  p.proargnames,
                  p.proargmodes,
                  information_schema._pg_expandarray(COALESCE(p.proallargtypes, (p.proargtypes)::oid[])) AS x
                 FROM pg_namespace n,
                  pg_proc p
                WHERE ((n.oid = p.pronamespace) AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text)))) ss
        WHERE ((t.oid = (ss.x).x) AND (t.typnamespace = nt.oid));
        """), where);
    }

    /**
     * Create an aliased <code>information_schema.parameters</code> table
     * reference
     */
    public Parameters(String alias) {
        this(DSL.name(alias), PARAMETERS);
    }

    /**
     * Create an aliased <code>information_schema.parameters</code> table
     * reference
     */
    public Parameters(Name alias) {
        this(alias, PARAMETERS);
    }

    /**
     * Create a <code>information_schema.parameters</code> table reference
     */
    public Parameters() {
        this(DSL.name("parameters"), null);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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