/*
 * This file is generated by jOOQ.
 */
package org.jooq.meta.derby.sys.tables;


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 Sysschemas extends TableImpl<Record> {

    private static final long serialVersionUID = 1L;

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

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

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

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

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

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

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

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

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

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

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

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

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

    private transient Sysaliases _sysaliases;

    /**
     * Get the implicit to-many join path to the <code>SYS.SYSALIASES</code>
     * table
     */
    public Sysaliases sysaliases() {
        if (_sysaliases == null)
            _sysaliases = new Sysaliases(this, null, Keys.SYNTHETIC_FK_SYSALIASES__SYNTHETIC_PK_SYSSCHEMAS.getInverseKey());

        return _sysaliases;
    }

    private transient Sysconstraints _sysconstraints;

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

        return _sysconstraints;
    }

    private transient Syssequences _syssequences;

    /**
     * Get the implicit to-many join path to the <code>SYS.SYSSEQUENCES</code>
     * table
     */
    public Syssequences syssequences() {
        if (_syssequences == null)
            _syssequences = new Syssequences(this, null, Keys.SYNTHETIC_FK_SYSSEQUENCES__SYNTHETIC_PK_SYSSCHEMAS.getInverseKey());

        return _syssequences;
    }

    private transient Systables _systables;

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

        return _systables;
    }

    private transient Systriggers _systriggers;

    /**
     * Get the implicit to-many join path to the <code>SYS.SYSTRIGGERS</code>
     * table
     */
    public Systriggers systriggers() {
        if (_systriggers == null)
            _systriggers = new Systriggers(this, null, Keys.SYNTHETIC_FK_SYSTRIGGERS__SYNTHETIC_PK_SYSSCHEMAS.getInverseKey());

        return _systriggers;
    }

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

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

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