/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.registration_change_address.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.registration_change_address.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.registration_change_address.RegistrationChangeAddress;
import ru.micord.webbpm.ervu.business_metrics.db_beans.registration_change_address.tables.records.ImpositionTmpMeasuresRecord;


/**
 * Постановка на воинский учет при смене адреса. Временные меры, введенные в
 * первом ВК
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ImpositionTmpMeasures extends TableImpl<ImpositionTmpMeasuresRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>registration_change_address.imposition_tmp_measures</code>
     */
    public static final ImpositionTmpMeasures IMPOSITION_TMP_MEASURES = new ImpositionTmpMeasures();

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

    /**
     * The column
     * <code>registration_change_address.imposition_tmp_measures.imposition_tmp_measures_id</code>.
     */
    public final TableField<ImpositionTmpMeasuresRecord, Long> IMPOSITION_TMP_MEASURES_ID = createField(DSL.name("imposition_tmp_measures_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>registration_change_address.imposition_tmp_measures.count_refused_in_second</code>.
     * снято мер во 2 ВК
     */
    public final TableField<ImpositionTmpMeasuresRecord, Long> COUNT_REFUSED_IN_SECOND = createField(DSL.name("count_refused_in_second"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "снято мер во 2 ВК");

    /**
     * The column
     * <code>registration_change_address.imposition_tmp_measures.count_accepted_in_second</code>.
     * подтверждено мер во 2 ВК
     */
    public final TableField<ImpositionTmpMeasuresRecord, Long> COUNT_ACCEPTED_IN_SECOND = createField(DSL.name("count_accepted_in_second"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "подтверждено мер во 2 ВК");

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

    private ImpositionTmpMeasures(Name alias, Table<ImpositionTmpMeasuresRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Постановка на воинский учет при смене адреса. Временные меры, введенные в первом ВК"), TableOptions.table(), where);
    }

    /**
     * Create an aliased
     * <code>registration_change_address.imposition_tmp_measures</code> table
     * reference
     */
    public ImpositionTmpMeasures(String alias) {
        this(DSL.name(alias), IMPOSITION_TMP_MEASURES);
    }

    /**
     * Create an aliased
     * <code>registration_change_address.imposition_tmp_measures</code> table
     * reference
     */
    public ImpositionTmpMeasures(Name alias) {
        this(alias, IMPOSITION_TMP_MEASURES);
    }

    /**
     * Create a <code>registration_change_address.imposition_tmp_measures</code>
     * table reference
     */
    public ImpositionTmpMeasures() {
        this(DSL.name("imposition_tmp_measures"), null);
    }

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

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

    @Override
    public UniqueKey<ImpositionTmpMeasuresRecord> getPrimaryKey() {
        return Keys.IMPOSITION_TMP_MEASURES_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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