/*
 * This file is generated by jOOQ.
 */
package com.epam.ta.reportportal.jooq.tables;


import com.epam.ta.reportportal.jooq.Indexes;
import com.epam.ta.reportportal.jooq.JPublic;
import com.epam.ta.reportportal.jooq.Keys;
import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeRecord;

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

import javax.annotation.processing.Generated;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row6;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.TableImpl;


/**
 * This class is generated by jOOQ.
 */
@Generated(
    value = {
        "http://www.jooq.org",
        "jOOQ version:3.12.4"
    },
    comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class JIssueType extends TableImpl<JIssueTypeRecord> {

    private static final long serialVersionUID = -1978728165;

    /**
     * The reference instance of <code>public.issue_type</code>
     */
    public static final JIssueType ISSUE_TYPE = new JIssueType();

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

    /**
     * The column <code>public.issue_type.id</code>.
     */
    public final TableField<JIssueTypeRecord, Long> ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('issue_type_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

    /**
     * The column <code>public.issue_type.issue_group_id</code>.
     */
    public final TableField<JIssueTypeRecord, Short> ISSUE_GROUP_ID = createField(DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT, this, "");

    /**
     * The column <code>public.issue_type.locator</code>.
     */
    public final TableField<JIssueTypeRecord, String> LOCATOR = createField(DSL.name("locator"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, "");

    /**
     * The column <code>public.issue_type.issue_name</code>.
     */
    public final TableField<JIssueTypeRecord, String> ISSUE_NAME = createField(DSL.name("issue_name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, "");

    /**
     * The column <code>public.issue_type.abbreviation</code>.
     */
    public final TableField<JIssueTypeRecord, String> ABBREVIATION = createField(DSL.name("abbreviation"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, "");

    /**
     * The column <code>public.issue_type.hex_color</code>.
     */
    public final TableField<JIssueTypeRecord, String> HEX_COLOR = createField(DSL.name("hex_color"), org.jooq.impl.SQLDataType.VARCHAR(7).nullable(false), this, "");

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

    /**
     * Create an aliased <code>public.issue_type</code> table reference
     */
    public JIssueType(String alias) {
        this(DSL.name(alias), ISSUE_TYPE);
    }

    /**
     * Create an aliased <code>public.issue_type</code> table reference
     */
    public JIssueType(Name alias) {
        this(alias, ISSUE_TYPE);
    }

    private JIssueType(Name alias, Table<JIssueTypeRecord> aliased) {
        this(alias, aliased, null);
    }

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

    public <O extends Record> JIssueType(Table<O> child, ForeignKey<O, JIssueTypeRecord> key) {
        super(child, key, ISSUE_TYPE);
    }

    @Override
    public Schema getSchema() {
        return JPublic.PUBLIC;
    }

    @Override
    public List<Index> getIndexes() {
        return Arrays.<Index>asList(Indexes.ISSUE_TYPE_GROUP_IDX, Indexes.ISSUE_TYPE_LOCATOR_KEY, Indexes.ISSUE_TYPE_PK);
    }

    @Override
    public Identity<JIssueTypeRecord, Long> getIdentity() {
        return Keys.IDENTITY_ISSUE_TYPE;
    }

    @Override
    public UniqueKey<JIssueTypeRecord> getPrimaryKey() {
        return Keys.ISSUE_TYPE_PK;
    }

    @Override
    public List<UniqueKey<JIssueTypeRecord>> getKeys() {
        return Arrays.<UniqueKey<JIssueTypeRecord>>asList(Keys.ISSUE_TYPE_PK, Keys.ISSUE_TYPE_LOCATOR_KEY);
    }

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

    public JIssueGroup issueGroup() {
        return new JIssueGroup(this, Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY);
    }

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

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

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

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

    // -------------------------------------------------------------------------
    // Row6 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row6<Long, Short, String, String, String, String> fieldsRow() {
        return (Row6) super.fieldsRow();
    }
}
