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


/**
 * Снятие с воинского учета. Решения на подписании
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DecisionsSigning extends TableImpl<DecisionsSigningRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>deregistration.decisions_signing</code>
     */
    public static final DecisionsSigning DECISIONS_SIGNING = new DecisionsSigning();

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

    /**
     * The column
     * <code>deregistration.decisions_signing.decisions_signing_id</code>.
     */
    public final TableField<DecisionsSigningRecord, Long> DECISIONS_SIGNING_ID = createField(DSL.name("decisions_signing_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>deregistration.decisions_signing.update_date</code>.
     */
    public final TableField<DecisionsSigningRecord, 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.decisions_signing.info_date</code>.
     */
    public final TableField<DecisionsSigningRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column
     * <code>deregistration.decisions_signing.count_arrived_death_reason</code>.
     * поступило по причине смерти
     */
    public final TableField<DecisionsSigningRecord, Long> COUNT_ARRIVED_DEATH_REASON = createField(DSL.name("count_arrived_death_reason"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "поступило по причине смерти");

    /**
     * The column
     * <code>deregistration.decisions_signing.count_arrived_age_limit</code>.
     * поступило по предельному возрасту
     */
    public final TableField<DecisionsSigningRecord, Long> COUNT_ARRIVED_AGE_LIMIT = createField(DSL.name("count_arrived_age_limit"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "поступило по предельному возрасту");

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

    private DecisionsSigning(Name alias, Table<DecisionsSigningRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Снятие с воинского учета. Решения на подписании"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>deregistration.decisions_signing</code> table
     * reference
     */
    public DecisionsSigning(Name alias) {
        this(alias, DECISIONS_SIGNING);
    }

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

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

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

    @Override
    public UniqueKey<DecisionsSigningRecord> getPrimaryKey() {
        return Keys.DECISIONS_SIGNING_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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