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


import java.math.BigDecimal;
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.forecast.Forecast;
import ru.micord.ervu_dashboard.db_beans.forecast.Keys;
import ru.micord.ervu_dashboard.db_beans.forecast.tables.records.DefermentConscriptionRecord;


/**
 * Отсрочка от призыва
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DefermentConscription extends TableImpl<DefermentConscriptionRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>forecast.deferment_conscription</code>
     */
    public static final DefermentConscription DEFERMENT_CONSCRIPTION = new DefermentConscription();

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

    /**
     * The column
     * <code>forecast.deferment_conscription.deferment_conscription_id</code>.
     */
    public final TableField<DefermentConscriptionRecord, Long> DEFERMENT_CONSCRIPTION_ID = createField(DSL.name("deferment_conscription_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>forecast.deferment_conscription.recruitment_id</code>.
     */
    public final TableField<DefermentConscriptionRecord, UUID> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.UUID.nullable(false), this, "");

    /**
     * The column <code>forecast.deferment_conscription.recording_date</code>.
     */
    public final TableField<DefermentConscriptionRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.DATE)), this, "");

    /**
     * The column <code>forecast.deferment_conscription.schema</code>.
     */
    public final TableField<DefermentConscriptionRecord, String> SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(64).nullable(false).defaultValue(DSL.field(DSL.raw("'empty'::character varying"), SQLDataType.VARCHAR)), this, "");

    /**
     * The column
     * <code>forecast.deferment_conscription.eligible_deferment</code>. Имеют
     * право на отсрочку
     */
    public final TableField<DefermentConscriptionRecord, BigDecimal> ELIGIBLE_DEFERMENT = createField(DSL.name("eligible_deferment"), SQLDataType.NUMERIC, this, "Имеют право на отсрочку");

    /**
     * The column
     * <code>forecast.deferment_conscription.deferment_granted</code>.
     * Предоставлена отсрочка
     */
    public final TableField<DefermentConscriptionRecord, BigDecimal> DEFERMENT_GRANTED = createField(DSL.name("deferment_granted"), SQLDataType.NUMERIC, this, "Предоставлена отсрочка");

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

    private DefermentConscription(Name alias, Table<DefermentConscriptionRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Отсрочка от призыва"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>forecast.deferment_conscription</code> table
     * reference
     */
    public DefermentConscription(String alias) {
        this(DSL.name(alias), DEFERMENT_CONSCRIPTION);
    }

    /**
     * Create an aliased <code>forecast.deferment_conscription</code> table
     * reference
     */
    public DefermentConscription(Name alias) {
        this(alias, DEFERMENT_CONSCRIPTION);
    }

    /**
     * Create a <code>forecast.deferment_conscription</code> table reference
     */
    public DefermentConscription() {
        this(DSL.name("deferment_conscription"), null);
    }

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

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

    @Override
    public UniqueKey<DefermentConscriptionRecord> getPrimaryKey() {
        return Keys.PK_DEFERMENT_CONSCRIPTION;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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