/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables;


import java.sql.Timestamp;
import java.util.Collection;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.SQL;
import org.jooq.Schema;
import org.jooq.Select;
import org.jooq.Stringly;
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 ru.micord.ervu_dashboard.db_beans.ervu_dashboard.ErvuDashboard;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.Keys;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.records.ReasonDictRecord;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ReasonDict extends TableImpl<ReasonDictRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.reason_dict</code>
     */
    public static final ReasonDict REASON_DICT = new ReasonDict();

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

    /**
     * The column <code>ervu_dashboard.reason_dict.code</code>.
     */
    public final TableField<ReasonDictRecord, Integer> CODE = createField(DSL.name("code"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>ervu_dashboard.reason_dict.description</code>.
     */
    public final TableField<ReasonDictRecord, String> DESCRIPTION = createField(DSL.name("description"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column <code>ervu_dashboard.reason_dict.created_at</code>.
     */
    public final TableField<ReasonDictRecord, Timestamp> CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMP(0).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMP)), this, "");

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

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

    /**
     * Create an aliased <code>ervu_dashboard.reason_dict</code> table reference
     */
    public ReasonDict(String alias) {
        this(DSL.name(alias), REASON_DICT);
    }

    /**
     * Create an aliased <code>ervu_dashboard.reason_dict</code> table reference
     */
    public ReasonDict(Name alias) {
        this(alias, REASON_DICT);
    }

    /**
     * Create a <code>ervu_dashboard.reason_dict</code> table reference
     */
    public ReasonDict() {
        this(DSL.name("reason_dict"), null);
    }

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

    @Override
    public UniqueKey<ReasonDictRecord> getPrimaryKey() {
        return Keys.REASON_DICT_PKEY;
    }

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

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

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

    /**
     * Rename this table
     */
    @Override
    public ReasonDict rename(String name) {
        return new ReasonDict(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public ReasonDict rename(Name name) {
        return new ReasonDict(name, null);
    }

    /**
     * Rename this table
     */
    @Override
    public ReasonDict rename(Table<?> name) {
        return new ReasonDict(name.getQualifiedName(), null);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonDict where(Condition condition) {
        return new ReasonDict(getQualifiedName(), aliased() ? this : null, null, condition);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonDict where(Collection<? extends Condition> conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonDict where(Condition... conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonDict where(Field<Boolean> condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonDict where(SQL condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonDict where(@Stringly.SQL String condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonDict where(@Stringly.SQL String condition, Object... binds) {
        return where(DSL.condition(condition, binds));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public ReasonDict where(@Stringly.SQL String condition, QueryPart... parts) {
        return where(DSL.condition(condition, parts));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonDict whereExists(Select<?> select) {
        return where(DSL.exists(select));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public ReasonDict whereNotExists(Select<?> select) {
        return where(DSL.notExists(select));
    }
}
