/*
 * This file is generated by jOOQ.
 */
package org.jooq.meta.h2.information_schema.tables;


import java.util.Arrays;
import java.util.List;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
import org.jooq.Record;
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;
import org.jooq.meta.h2.information_schema.InformationSchema;
import org.jooq.meta.h2.information_schema.Keys;


/**
 * This class is generated by jOOQ.
 *
 * @deprecated - [#17388] [#17389] - 3.20.0 - Use the classes from the
 *             <code>information_schema_2</code> package, instead.
 */
@Deprecated
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CrossReferences extends TableImpl<Record> {

    private static final long serialVersionUID = 917541835;

    /**
     * The reference instance of <code>INFORMATION_SCHEMA.CROSS_REFERENCES</code>
     */
    public static final CrossReferences CROSS_REFERENCES = new CrossReferences();

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

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.PKTABLE_CATALOG</code>.
     */
    public final TableField<Record, String> PKTABLE_CATALOG = createField(DSL.name("PKTABLE_CATALOG"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.PKTABLE_SCHEMA</code>.
     */
    public final TableField<Record, String> PKTABLE_SCHEMA = createField(DSL.name("PKTABLE_SCHEMA"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.PKTABLE_NAME</code>.
     */
    public final TableField<Record, String> PKTABLE_NAME = createField(DSL.name("PKTABLE_NAME"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.PKCOLUMN_NAME</code>.
     */
    public final TableField<Record, String> PKCOLUMN_NAME = createField(DSL.name("PKCOLUMN_NAME"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.FKTABLE_CATALOG</code>.
     */
    public final TableField<Record, String> FKTABLE_CATALOG = createField(DSL.name("FKTABLE_CATALOG"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.FKTABLE_SCHEMA</code>.
     */
    public final TableField<Record, String> FKTABLE_SCHEMA = createField(DSL.name("FKTABLE_SCHEMA"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.FKTABLE_NAME</code>.
     */
    public final TableField<Record, String> FKTABLE_NAME = createField(DSL.name("FKTABLE_NAME"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.FKCOLUMN_NAME</code>.
     */
    public final TableField<Record, String> FKCOLUMN_NAME = createField(DSL.name("FKCOLUMN_NAME"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.ORDINAL_POSITION</code>.
     */
    public final TableField<Record, Short> ORDINAL_POSITION = createField(DSL.name("ORDINAL_POSITION"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.UPDATE_RULE</code>.
     */
    public final TableField<Record, Short> UPDATE_RULE = createField(DSL.name("UPDATE_RULE"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.DELETE_RULE</code>.
     */
    public final TableField<Record, Short> DELETE_RULE = createField(DSL.name("DELETE_RULE"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.FK_NAME</code>.
     */
    public final TableField<Record, String> FK_NAME = createField(DSL.name("FK_NAME"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.PK_NAME</code>.
     */
    public final TableField<Record, String> PK_NAME = createField(DSL.name("PK_NAME"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>INFORMATION_SCHEMA.CROSS_REFERENCES.DEFERRABILITY</code>.
     */
    public final TableField<Record, Short> DEFERRABILITY = createField(DSL.name("DEFERRABILITY"), SQLDataType.SMALLINT, this, "");

    private CrossReferences(Name alias, Table<Record> aliased) {
        this(alias, aliased, null);
    }

    private CrossReferences(Name alias, Table<Record> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
    }

    /**
     * Create an aliased <code>INFORMATION_SCHEMA.CROSS_REFERENCES</code> table reference
     */
    public CrossReferences(String alias) {
        this(DSL.name(alias), CROSS_REFERENCES);
    }

    /**
     * Create an aliased <code>INFORMATION_SCHEMA.CROSS_REFERENCES</code> table reference
     */
    public CrossReferences(Name alias) {
        this(alias, CROSS_REFERENCES);
    }

    /**
     * Create a <code>INFORMATION_SCHEMA.CROSS_REFERENCES</code> table reference
     */
    public CrossReferences() {
        this(DSL.name("CROSS_REFERENCES"), null);
    }

    public <O extends Record> CrossReferences(Table<O> child, ForeignKey<O, Record> key) {
        super(child, key, CROSS_REFERENCES);
    }

    @Override
    public Schema getSchema() {
        return InformationSchema.INFORMATION_SCHEMA;
    }

    @Override
    public List<ForeignKey<Record, ?>> getReferences() {
        return Arrays.<ForeignKey<Record, ?>>asList(Keys.REFERENCED_CONSTRAINT, Keys.REFERENCING_CONSTRAINT);
    }

    public Constraints referencedConstraint() {
        return new Constraints(this, Keys.REFERENCED_CONSTRAINT);
    }

    public Constraints referencingConstraint() {
        return new Constraints(this, Keys.REFERENCING_CONSTRAINT);
    }

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

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

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

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