/*
 * 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.UniqueKey;
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 Sysconglomerates extends TableImpl<Record> {

    private static final long serialVersionUID = 1L;

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

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

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

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

    /**
     * The column <code>SYS.SYSCONGLOMERATES.CONGLOMERATENUMBER</code>.
     */
    public final TableField<Record, Long> CONGLOMERATENUMBER = createField(DSL.name("CONGLOMERATENUMBER"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>SYS.SYSCONGLOMERATES.CONGLOMERATENAME</code>.
     */
    public final TableField<Record, String> CONGLOMERATENAME = createField(DSL.name("CONGLOMERATENAME"), SQLDataType.VARCHAR(128), this, "");

    /**
     * The column <code>SYS.SYSCONGLOMERATES.ISINDEX</code>.
     */
    public final TableField<Record, Boolean> ISINDEX = createField(DSL.name("ISINDEX"), SQLDataType.BOOLEAN.nullable(false), this, "");

    /**
     * The column <code>SYS.SYSCONGLOMERATES.DESCRIPTOR</code>.
     */
    public final TableField<Record, String> DESCRIPTOR = createField(DSL.name("DESCRIPTOR"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>SYS.SYSCONGLOMERATES.ISCONSTRAINT</code>.
     */
    public final TableField<Record, Boolean> ISCONSTRAINT = createField(DSL.name("ISCONSTRAINT"), SQLDataType.BOOLEAN, this, "");

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

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

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

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

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

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

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

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

    @Override
    public UniqueKey<Record> getPrimaryKey() {
        return Keys.SYNTHETIC_PK_SYSCONGLOMERATES;
    }

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

    private transient Systables _systables;

    /**
     * Get the implicit join path to the <code>SYS.SYSTABLES</code> table.
     */
    public Systables systables() {
        if (_systables == null)
            _systables = new Systables(this, Keys.SYNTHETIC_FK_SYSCONGLOMERATES__SYNTHETIC_PK_SYSTABLES, null);

        return _systables;
    }

    private transient Syskeys _syskeys;

    /**
     * Get the implicit to-many join path to the <code>SYS.SYSKEYS</code> table
     */
    public Syskeys syskeys() {
        if (_syskeys == null)
            _syskeys = new Syskeys(this, null, Keys.SYNTHETIC_FK_SYSKEYS__SYNTHETIC_PK_SYSCONGLOMERATES.getInverseKey());

        return _syskeys;
    }

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

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

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