/*
 * 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.Identity;
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.DeltaRecord;


/**
 * таблица с параметром, на основе которого загружается дельта по гражданам
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Delta extends TableImpl<DeltaRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.delta</code>
     */
    public static final Delta DELTA = new Delta();

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

    /**
     * The column <code>ervu_dashboard.delta.delta_id</code>.
     */
    public final TableField<DeltaRecord, Long> DELTA_ID = createField(DSL.name("delta_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ervu_dashboard.delta.value</code>. дата, от которой
     * необходимо грузить данные
     */
    public final TableField<DeltaRecord, Timestamp> VALUE = createField(DSL.name("value"), SQLDataType.TIMESTAMP(0), this, "дата, от которой необходимо грузить данные");

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

    private Delta(Name alias, Table<DeltaRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("таблица с параметром, на основе которого загружается дельта по гражданам"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.delta</code> table reference
     */
    public Delta(Name alias) {
        this(alias, DELTA);
    }

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

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

    @Override
    public Identity<DeltaRecord, Long> getIdentity() {
        return (Identity<DeltaRecord, Long>) super.getIdentity();
    }

    @Override
    public UniqueKey<DeltaRecord> getPrimaryKey() {
        return Keys.PK_DELTA;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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