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


import java.sql.Timestamp;
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 Systriggers extends TableImpl<Record> {

    private static final long serialVersionUID = 1L;

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

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

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

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

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

    /**
     * The column <code>SYS.SYSTRIGGERS.CREATIONTIMESTAMP</code>.
     */
    public final TableField<Record, Timestamp> CREATIONTIMESTAMP = createField(DSL.name("CREATIONTIMESTAMP"), SQLDataType.TIMESTAMP(9).nullable(false), this, "");

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

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

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

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

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

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

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

    /**
     * @deprecated Unknown data type. If this is a qualified, user-defined type,
     * it may have been excluded from code generation. If this is a built-in
     * type, you can define an explicit {@link org.jooq.Binding} to specify how
     * this type should be handled. Deprecation can be turned off using
     * {@literal <deprecationOnUnknownTypes/>} in your code generator
     * configuration.
     */
    @Deprecated
    public final TableField<Record, Object> REFERENCEDCOLUMNS = createField(DSL.name("REFERENCEDCOLUMNS"), org.jooq.impl.SQLDataType.OTHER, this, "");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    private transient Sysschemas _sysschemas;

    /**
     * Get the implicit join path to the <code>SYS.SYSSCHEMAS</code> table.
     */
    public Sysschemas sysschemas() {
        if (_sysschemas == null)
            _sysschemas = new Sysschemas(this, Keys.SYNTHETIC_FK_SYSTRIGGERS__SYNTHETIC_PK_SYSSCHEMAS, null);

        return _sysschemas;
    }

    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_SYSTRIGGERS__SYNTHETIC_PK_SYSTABLES, null);

        return _systables;
    }

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

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

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