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

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 UserDefinedTypes extends TableImpl<UserDefinedTypesRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>information_schema.user_defined_types</code>
     */
    public static final UserDefinedTypes USER_DEFINED_TYPES = new UserDefinedTypes();

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

    /**
     * The column
     * <code>information_schema.user_defined_types.user_defined_type_catalog</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> USER_DEFINED_TYPE_CATALOG = createField(DSL.name("user_defined_type_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.user_defined_type_schema</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> USER_DEFINED_TYPE_SCHEMA = createField(DSL.name("user_defined_type_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.user_defined_type_name</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> USER_DEFINED_TYPE_NAME = createField(DSL.name("user_defined_type_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.user_defined_type_category</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> USER_DEFINED_TYPE_CATEGORY = createField(DSL.name("user_defined_type_category"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.is_instantiable</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> IS_INSTANTIABLE = createField(DSL.name("is_instantiable"), Domains.YES_OR_NO.getDataType(), this, "");

    /**
     * The column <code>information_schema.user_defined_types.is_final</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> IS_FINAL = createField(DSL.name("is_final"), Domains.YES_OR_NO.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.ordering_form</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> ORDERING_FORM = createField(DSL.name("ordering_form"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.ordering_category</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> ORDERING_CATEGORY = createField(DSL.name("ordering_category"), Domains.CHARACTER_DATA.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.ordering_routine_catalog</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> ORDERING_ROUTINE_CATALOG = createField(DSL.name("ordering_routine_catalog"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.ordering_routine_schema</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> ORDERING_ROUTINE_SCHEMA = createField(DSL.name("ordering_routine_schema"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.ordering_routine_name</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> ORDERING_ROUTINE_NAME = createField(DSL.name("ordering_routine_name"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.reference_type</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> REFERENCE_TYPE = createField(DSL.name("reference_type"), Domains.CHARACTER_DATA.getDataType(), this, "");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * The column
     * <code>information_schema.user_defined_types.source_dtd_identifier</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> SOURCE_DTD_IDENTIFIER = createField(DSL.name("source_dtd_identifier"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

    /**
     * The column
     * <code>information_schema.user_defined_types.ref_dtd_identifier</code>.
     */
    public final TableField<UserDefinedTypesRecord, String> REF_DTD_IDENTIFIER = createField(DSL.name("ref_dtd_identifier"), Domains.SQL_IDENTIFIER.getDataType(), this, "");

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

    private UserDefinedTypes(Name alias, Table<UserDefinedTypesRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "user_defined_types" as  SELECT (current_database())::information_schema.sql_identifier AS user_defined_type_catalog,
          (n.nspname)::information_schema.sql_identifier AS user_defined_type_schema,
          (c.relname)::information_schema.sql_identifier AS user_defined_type_name,
          ('STRUCTURED'::character varying)::information_schema.character_data AS user_defined_type_category,
          ('YES'::character varying)::information_schema.yes_or_no AS is_instantiable,
          (NULL::character varying)::information_schema.yes_or_no AS is_final,
          (NULL::character varying)::information_schema.character_data AS ordering_form,
          (NULL::character varying)::information_schema.character_data AS ordering_category,
          (NULL::name)::information_schema.sql_identifier AS ordering_routine_catalog,
          (NULL::name)::information_schema.sql_identifier AS ordering_routine_schema,
          (NULL::name)::information_schema.sql_identifier AS ordering_routine_name,
          (NULL::character varying)::information_schema.character_data AS reference_type,
          (NULL::character varying)::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,
          (NULL::name)::information_schema.sql_identifier AS source_dtd_identifier,
          (NULL::name)::information_schema.sql_identifier AS ref_dtd_identifier
         FROM pg_namespace n,
          pg_class c,
          pg_type t
        WHERE ((n.oid = c.relnamespace) AND (t.typrelid = c.oid) AND (c.relkind = 'c'::"char") AND (pg_has_role(t.typowner, 'USAGE'::text) OR has_type_privilege(t.oid, 'USAGE'::text)));
        """), where);
    }

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

    /**
     * Create an aliased <code>information_schema.user_defined_types</code>
     * table reference
     */
    public UserDefinedTypes(Name alias) {
        this(alias, USER_DEFINED_TYPES);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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