/*
 * This file is generated by jOOQ.
 */
package org.jooq.meta.firebird.rdb.tables;


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

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import org.jooq.meta.firebird.rdb.Keys;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>RDB$INDICES</code>
     */
    public static final Rdb$indices RDB$INDICES = new Rdb$indices();

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

    /**
     * The column <code>RDB$INDICES.RDB$INDEX_NAME</code>.
     */
    public final TableField<Record, String> RDB$INDEX_NAME = createField(DSL.name("RDB$INDEX_NAME"), SQLDataType.CHAR(63), this, "");

    /**
     * The column <code>RDB$INDICES.RDB$RELATION_NAME</code>.
     */
    public final TableField<Record, String> RDB$RELATION_NAME = createField(DSL.name("RDB$RELATION_NAME"), SQLDataType.CHAR(63), this, "");

    /**
     * The column <code>RDB$INDICES.RDB$INDEX_ID</code>.
     */
    public final TableField<Record, Short> RDB$INDEX_ID = createField(DSL.name("RDB$INDEX_ID"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$UNIQUE_FLAG</code>.
     */
    public final TableField<Record, Short> RDB$UNIQUE_FLAG = createField(DSL.name("RDB$UNIQUE_FLAG"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$DESCRIPTION</code>.
     */
    public final TableField<Record, String> RDB$DESCRIPTION = createField(DSL.name("RDB$DESCRIPTION"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$SEGMENT_COUNT</code>.
     */
    public final TableField<Record, Short> RDB$SEGMENT_COUNT = createField(DSL.name("RDB$SEGMENT_COUNT"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$INDEX_INACTIVE</code>.
     */
    public final TableField<Record, Short> RDB$INDEX_INACTIVE = createField(DSL.name("RDB$INDEX_INACTIVE"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$INDEX_TYPE</code>.
     */
    public final TableField<Record, Short> RDB$INDEX_TYPE = createField(DSL.name("RDB$INDEX_TYPE"), SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$FOREIGN_KEY</code>.
     */
    public final TableField<Record, String> RDB$FOREIGN_KEY = createField(DSL.name("RDB$FOREIGN_KEY"), SQLDataType.CHAR(63), this, "");

    /**
     * The column <code>RDB$INDICES.RDB$SYSTEM_FLAG</code>.
     */
    public final TableField<Record, Short> RDB$SYSTEM_FLAG = createField(DSL.name("RDB$SYSTEM_FLAG"), SQLDataType.SMALLINT.nullable(false), this, "");

    /**
     * The column <code>RDB$INDICES.RDB$EXPRESSION_BLR</code>.
     */
    public final TableField<Record, byte[]> RDB$EXPRESSION_BLR = createField(DSL.name("RDB$EXPRESSION_BLR"), SQLDataType.BLOB, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$EXPRESSION_SOURCE</code>.
     */
    public final TableField<Record, String> RDB$EXPRESSION_SOURCE = createField(DSL.name("RDB$EXPRESSION_SOURCE"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>RDB$INDICES.RDB$STATISTICS</code>.
     */
    public final TableField<Record, Double> RDB$STATISTICS = createField(DSL.name("RDB$STATISTICS"), SQLDataType.DOUBLE, this, "");

    private Rdb$indices(Name alias, Table<Record> aliased) {
        this(alias, aliased, (Field<?>[]) null, null);
    }

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

    /**
     * Create an aliased <code>RDB$INDICES</code> table reference
     */
    public Rdb$indices(String alias) {
        this(DSL.name(alias), RDB$INDICES);
    }

    /**
     * Create an aliased <code>RDB$INDICES</code> table reference
     */
    public Rdb$indices(Name alias) {
        this(alias, RDB$INDICES);
    }

    /**
     * Create a <code>RDB$INDICES</code> table reference
     */
    public Rdb$indices() {
        this(DSL.name("RDB$INDICES"), null);
    }

    public <O extends Record> Rdb$indices(Table<O> path, ForeignKey<O, Record> childPath, InverseForeignKey<O, Record> parentPath) {
        super(path, childPath, parentPath, RDB$INDICES);
    }

    @Override
    public List<UniqueKey<Record>> getUniqueKeys() {
        return Arrays.asList(Keys.RDB$INDEX_5);
    }

    private transient Rdb$indexSegments _rdb$indexSegments;

    /**
     * Get the implicit to-many join path to the <code>RDB$INDEX_SEGMENTS</code>
     * table
     */
    public Rdb$indexSegments rdb$indexSegments() {
        if (_rdb$indexSegments == null)
            _rdb$indexSegments = new Rdb$indexSegments(this, null, Keys.SYNTHETIC_FK_RDB$INDEX_SEGMENTS__RDB$INDEX_5.getInverseKey());

        return _rdb$indexSegments;
    }

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

    @Override
    public Rdb$indices as(Name alias) {
        return new Rdb$indices(alias, this);
    }

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