/*
 * This file is generated by jOOQ.
 */
package stroom.explorer.impl.db.jooq.tables;


import stroom.explorer.impl.db.jooq.Indexes;
import stroom.explorer.impl.db.jooq.Keys;
import stroom.explorer.impl.db.jooq.Stroom;
import stroom.explorer.impl.db.jooq.tables.records.ExplorerPathRecord;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row4;
import org.jooq.Schema;
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 java.util.Arrays;
import java.util.List;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>stroom.explorer_path</code>
     */
    public static final ExplorerPath EXPLORER_PATH = new ExplorerPath();

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

    /**
     * The column <code>stroom.explorer_path.ancestor</code>.
     */
    public final TableField<ExplorerPathRecord, Integer> ANCESTOR = createField(DSL.name("ancestor"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>stroom.explorer_path.descendant</code>.
     */
    public final TableField<ExplorerPathRecord, Integer> DESCENDANT = createField(DSL.name("descendant"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>stroom.explorer_path.depth</code>.
     */
    public final TableField<ExplorerPathRecord, Integer> DEPTH = createField(DSL.name("depth"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>stroom.explorer_path.order_index</code>.
     */
    public final TableField<ExplorerPathRecord, Integer> ORDER_INDEX = createField(DSL.name("order_index"), SQLDataType.INTEGER.nullable(false), this, "");

    private ExplorerPath(Name alias, Table<ExplorerPathRecord> aliased) {
        this(alias, aliased, null);
    }

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

    /**
     * Create an aliased <code>stroom.explorer_path</code> table reference
     */
    public ExplorerPath(String alias) {
        this(DSL.name(alias), EXPLORER_PATH);
    }

    /**
     * Create an aliased <code>stroom.explorer_path</code> table reference
     */
    public ExplorerPath(Name alias) {
        this(alias, EXPLORER_PATH);
    }

    /**
     * Create a <code>stroom.explorer_path</code> table reference
     */
    public ExplorerPath() {
        this(DSL.name("explorer_path"), null);
    }

    public <O extends Record> ExplorerPath(Table<O> child, ForeignKey<O, ExplorerPathRecord> key) {
        super(child, key, EXPLORER_PATH);
    }

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

    @Override
    public List<Index> getIndexes() {
        return Arrays.asList(Indexes.EXPLORER_PATH_EXPLORER_PATH_ANCESTOR_DEPTH_ORDER_INDEX, Indexes.EXPLORER_PATH_EXPLORER_PATH_DEPTH, Indexes.EXPLORER_PATH_EXPLORER_PATH_DESCENDANT, Indexes.EXPLORER_PATH_EXPLORER_PATH_DESCENDANT_DEPTH);
    }

    @Override
    public UniqueKey<ExplorerPathRecord> getPrimaryKey() {
        return Keys.KEY_EXPLORER_PATH_PRIMARY;
    }

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

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

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

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

    // -------------------------------------------------------------------------
    // Row4 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row4<Integer, Integer, Integer, Integer> fieldsRow() {
        return (Row4) super.fieldsRow();
    }
}
