/*
 * This file is generated by jOOQ.
 */
package org.jooq.meta.derby.sys.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.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.derby.sys.Keys;
import org.jooq.meta.derby.sys.Sys;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
public class Syskeys extends TableImpl<Record> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>SYS.SYSKEYS</code>
     */
    public static final Syskeys SYSKEYS = new Syskeys();

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

    /**
     * The column <code>SYS.SYSKEYS.CONSTRAINTID</code>.
     */
    public final TableField<Record, String> CONSTRAINTID = createField(DSL.name("CONSTRAINTID"), SQLDataType.CHAR(36).nullable(false), this, "");

    /**
     * The column <code>SYS.SYSKEYS.CONGLOMERATEID</code>.
     */
    public final TableField<Record, String> CONGLOMERATEID = createField(DSL.name("CONGLOMERATEID"), SQLDataType.CHAR(36).nullable(false), this, "");

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

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

    /**
     * Create an aliased <code>SYS.SYSKEYS</code> table reference
     */
    public Syskeys(String alias) {
        this(DSL.name(alias), SYSKEYS);
    }

    /**
     * Create an aliased <code>SYS.SYSKEYS</code> table reference
     */
    public Syskeys(Name alias) {
        this(alias, SYSKEYS);
    }

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

    public <O extends Record> Syskeys(Table<O> path, ForeignKey<O, Record> childPath, InverseForeignKey<O, Record> parentPath) {
        super(path, childPath, parentPath, SYSKEYS);
    }

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

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

    private transient Sysconglomerates _sysconglomerates;

    /**
     * Get the implicit join path to the <code>SYS.SYSCONGLOMERATES</code>
     * table.
     */
    public Sysconglomerates sysconglomerates() {
        if (_sysconglomerates == null)
            _sysconglomerates = new Sysconglomerates(this, Keys.SYNTHETIC_FK_SYSKEYS__SYNTHETIC_PK_SYSCONGLOMERATES, null);

        return _sysconglomerates;
    }

    private transient Sysconstraints _sysconstraints;

    /**
     * Get the implicit join path to the <code>SYS.SYSCONSTRAINTS</code> table.
     */
    public Sysconstraints sysconstraints() {
        if (_sysconstraints == null)
            _sysconstraints = new Sysconstraints(this, Keys.SYNTHETIC_FK_SYSKEYS__SYNTHETIC_PK_SYSCONSTRAINTS, null);

        return _sysconstraints;
    }

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

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

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