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


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

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row2;
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 stroom.processor.impl.db.jooq.Keys;
import stroom.processor.impl.db.jooq.Stroom;
import stroom.processor.impl.db.jooq.tables.records.ProcessorNodeRecord;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>stroom.processor_node</code>
     */
    public static final ProcessorNode PROCESSOR_NODE = new ProcessorNode();

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

    /**
     * The column <code>stroom.processor_node.id</code>.
     */
    public final TableField<ProcessorNodeRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");

    /**
     * The column <code>stroom.processor_node.name</code>.
     */
    public final TableField<ProcessorNodeRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    private ProcessorNode(Name alias, Table<ProcessorNodeRecord> aliased) {
        this(alias, aliased, null);
    }

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

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

    /**
     * Create an aliased <code>stroom.processor_node</code> table reference
     */
    public ProcessorNode(Name alias) {
        this(alias, PROCESSOR_NODE);
    }

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

    public <O extends Record> ProcessorNode(Table<O> child, ForeignKey<O, ProcessorNodeRecord> key) {
        super(child, key, PROCESSOR_NODE);
    }

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

    @Override
    public Identity<ProcessorNodeRecord, Integer> getIdentity() {
        return (Identity<ProcessorNodeRecord, Integer>) super.getIdentity();
    }

    @Override
    public UniqueKey<ProcessorNodeRecord> getPrimaryKey() {
        return Keys.KEY_PROCESSOR_NODE_PRIMARY;
    }

    @Override
    public List<UniqueKey<ProcessorNodeRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.KEY_PROCESSOR_NODE_PROCESSOR_NODE_NAME);
    }

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

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

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

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

    // -------------------------------------------------------------------------
    // Row2 type methods
    // -------------------------------------------------------------------------

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