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

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.JSONB;
import org.jooq.Name;
import org.jooq.Schema;
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 JsonbEach extends TableImpl<JsonbEachRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.jsonb_each</code>
     */
    public static final JsonbEach JSONB_EACH = new JsonbEach();

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

    /**
     * The column <code>pg_catalog.jsonb_each.key</code>.
     */
    public final TableField<JsonbEachRecord, String> KEY = createField(DSL.name("key"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.jsonb_each.value</code>.
     */
    public final TableField<JsonbEachRecord, JSONB> VALUE = createField(DSL.name("value"), SQLDataType.JSONB, this, "");

    private JsonbEach(Name alias, Table<JsonbEachRecord> aliased) {
        this(alias, aliased, new Field[] {
            DSL.val(null, SQLDataType.JSONB)
        });
    }

    private JsonbEach(Name alias, Table<JsonbEachRecord> aliased, Field<?>[] parameters) {
        this(alias, aliased, parameters, null);
    }

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

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

    /**
     * Create an aliased <code>pg_catalog.jsonb_each</code> table reference
     */
    public JsonbEach(Name alias) {
        this(alias, JSONB_EACH);
    }

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

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

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

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

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

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

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

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

    /**
     * Call this table-valued function
     */
    public JsonbEach call(
          JSONB fromJson
    ) {
        JsonbEach result = new JsonbEach(DSL.name("jsonb_each"), null, new Field[] {
            DSL.val(fromJson, SQLDataType.JSONB)
        });

        return aliased() ? result.as(getUnqualifiedName()) : result;
    }

    /**
     * Call this table-valued function
     */
    public JsonbEach call(
          Field<JSONB> fromJson
    ) {
        JsonbEach result = new JsonbEach(DSL.name("jsonb_each"), null, new Field[] {
            fromJson
        });

        return aliased() ? result.as(getUnqualifiedName()) : result;
    }
}
