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

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.JSON;
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 JsonEach extends TableImpl<JsonEachRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.json_each</code>
     */
    public static final JsonEach JSON_EACH = new JsonEach();

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

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

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

    private JsonEach(Name alias, Table<JsonEachRecord> aliased) {
        this(alias, aliased, new Field[] {
            DSL.val(null, SQLDataType.JSON)
        });
    }

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

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

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

    /**
     * Create an aliased <code>pg_catalog.json_each</code> table reference
     */
    public JsonEach(Name alias) {
        this(alias, JSON_EACH);
    }

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

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

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

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

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

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

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

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

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

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

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

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