/*
 * 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 Syschecks extends TableImpl<Record> {

    private static final long serialVersionUID = 1L;

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

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

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

    /**
     * The column <code>SYS.SYSCHECKS.CHECKDEFINITION</code>.
     */
    public final TableField<Record, String> CHECKDEFINITION = createField(DSL.name("CHECKDEFINITION"), SQLDataType.LONGVARCHAR.nullable(false), 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.nullable(false), this, "");

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

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

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

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

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

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

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

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

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

        return _sysconstraints;
    }

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

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

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