/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.deregistration.tables;


import java.sql.Date;
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.webbpm.ervu.business_metrics.db_beans.deregistration.Deregistration;
import ru.micord.webbpm.ervu.business_metrics.db_beans.deregistration.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.deregistration.tables.records.RejectionDecisionsRecord;


/**
 * Снятие с воинского учета. Сформированные решения об отказе в снятии с ВУ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RejectionDecisions extends TableImpl<RejectionDecisionsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>deregistration.rejection_decisions</code>
     */
    public static final RejectionDecisions REJECTION_DECISIONS = new RejectionDecisions();

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

    /**
     * The column
     * <code>deregistration.rejection_decisions.rejection_decisions_id</code>.
     */
    public final TableField<RejectionDecisionsRecord, Long> REJECTION_DECISIONS_ID = createField(DSL.name("rejection_decisions_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>deregistration.rejection_decisions.recruitment_id</code>.
     */
    public final TableField<RejectionDecisionsRecord, String> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

    /**
     * The column <code>deregistration.rejection_decisions.update_date</code>.
     */
    public final TableField<RejectionDecisionsRecord, Timestamp> UPDATE_DATE = createField(DSL.name("update_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");

    /**
     * The column <code>deregistration.rejection_decisions.info_date</code>.
     */
    public final TableField<RejectionDecisionsRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column
     * <code>deregistration.rejection_decisions.count_for_sign</code>. Доступно
     * для подписания
     */
    public final TableField<RejectionDecisionsRecord, Long> COUNT_FOR_SIGN = createField(DSL.name("count_for_sign"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Доступно для подписания");

    /**
     * The column <code>deregistration.rejection_decisions.count_signed</code>.
     * Подписано
     */
    public final TableField<RejectionDecisionsRecord, Long> COUNT_SIGNED = createField(DSL.name("count_signed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Подписано");

    /**
     * The column <code>deregistration.rejection_decisions.count_refused</code>.
     * Отклонено
     */
    public final TableField<RejectionDecisionsRecord, Long> COUNT_REFUSED = createField(DSL.name("count_refused"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Отклонено");

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

    private RejectionDecisions(Name alias, Table<RejectionDecisionsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Снятие с воинского учета. Сформированные решения об отказе в снятии с ВУ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>deregistration.rejection_decisions</code> table
     * reference
     */
    public RejectionDecisions(String alias) {
        this(DSL.name(alias), REJECTION_DECISIONS);
    }

    /**
     * Create an aliased <code>deregistration.rejection_decisions</code> table
     * reference
     */
    public RejectionDecisions(Name alias) {
        this(alias, REJECTION_DECISIONS);
    }

    /**
     * Create a <code>deregistration.rejection_decisions</code> table reference
     */
    public RejectionDecisions() {
        this(DSL.name("rejection_decisions"), null);
    }

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

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

    @Override
    public UniqueKey<RejectionDecisionsRecord> getPrimaryKey() {
        return Keys.REJECTION_DECISIONS_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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