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


import java.sql.Date;
import java.util.Collection;
import java.util.UUID;

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.DefermentUnifiedDataRecord;


/**
 * Унифицированные данные об отсрочках и правах на отсрочку
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DefermentUnifiedData extends TableImpl<DefermentUnifiedDataRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.deferment_unified_data</code>
     */
    public static final DefermentUnifiedData DEFERMENT_UNIFIED_DATA = new DefermentUnifiedData();

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

    /**
     * The column <code>ervu_dashboard.deferment_unified_data.id</code>.
     * Уникальный идентификатор записи
     */
    public final TableField<DefermentUnifiedDataRecord, Long> ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "Уникальный идентификатор записи");

    /**
     * The column <code>ervu_dashboard.deferment_unified_data.recruit_id</code>.
     * ID призывника
     */
    public final TableField<DefermentUnifiedDataRecord, UUID> RECRUIT_ID = createField(DSL.name("recruit_id"), SQLDataType.UUID.nullable(false), this, "ID призывника");

    /**
     * The column
     * <code>ervu_dashboard.deferment_unified_data.decision_number</code>. Номер
     * решения
     */
    public final TableField<DefermentUnifiedDataRecord, String> DECISION_NUMBER = createField(DSL.name("decision_number"), SQLDataType.VARCHAR(255), this, "Номер решения");

    /**
     * The column
     * <code>ervu_dashboard.deferment_unified_data.deferment_type</code>. Тип
     * отсрочки/освобождения
     */
    public final TableField<DefermentUnifiedDataRecord, String> DEFERMENT_TYPE = createField(DSL.name("deferment_type"), SQLDataType.VARCHAR(255), this, "Тип отсрочки/освобождения");

    /**
     * The column <code>ervu_dashboard.deferment_unified_data.start_date</code>.
     * Дата начала действия
     */
    public final TableField<DefermentUnifiedDataRecord, Date> START_DATE = createField(DSL.name("start_date"), SQLDataType.DATE, this, "Дата начала действия");

    /**
     * The column <code>ervu_dashboard.deferment_unified_data.end_date</code>.
     * Дата окончания действия
     */
    public final TableField<DefermentUnifiedDataRecord, Date> END_DATE = createField(DSL.name("end_date"), SQLDataType.DATE, this, "Дата окончания действия");

    /**
     * The column
     * <code>ervu_dashboard.deferment_unified_data.reason_code</code>. Код
     * причины отсрочки
     */
    public final TableField<DefermentUnifiedDataRecord, String> REASON_CODE = createField(DSL.name("reason_code"), SQLDataType.VARCHAR(255), this, "Код причины отсрочки");

    /**
     * The column <code>ervu_dashboard.deferment_unified_data.active</code>.
     * Активна ли запись
     */
    public final TableField<DefermentUnifiedDataRecord, Boolean> ACTIVE = createField(DSL.name("active"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "Активна ли запись");

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

    private DefermentUnifiedData(Name alias, Table<DefermentUnifiedDataRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Унифицированные данные об отсрочках и правах на отсрочку"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.deferment_unified_data</code>
     * table reference
     */
    public DefermentUnifiedData(Name alias) {
        this(alias, DEFERMENT_UNIFIED_DATA);
    }

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

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

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

    @Override
    public UniqueKey<DefermentUnifiedDataRecord> getPrimaryKey() {
        return Keys.DEFERMENT_UNIFIED_DATA_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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