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


/**
 * Постановка на воинский учет при смене адреса. Изменения сведений при личной
 * явке
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ChangeDataPersonalVisit extends TableImpl<ChangeDataPersonalVisitRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>registration_change_address.change_data_personal_visit</code>
     */
    public static final ChangeDataPersonalVisit CHANGE_DATA_PERSONAL_VISIT = new ChangeDataPersonalVisit();

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

    /**
     * The column
     * <code>registration_change_address.change_data_personal_visit.change_data_personal_visit_id</code>.
     */
    public final TableField<ChangeDataPersonalVisitRecord, Long> CHANGE_DATA_PERSONAL_VISIT_ID = createField(DSL.name("change_data_personal_visit_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>registration_change_address.change_data_personal_visit.count_for_sign</code>.
     */
    public final TableField<ChangeDataPersonalVisitRecord, 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>registration_change_address.change_data_personal_visit.count_signed</code>.
     */
    public final TableField<ChangeDataPersonalVisitRecord, Long> COUNT_SIGNED = createField(DSL.name("count_signed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>registration_change_address.change_data_personal_visit.count_refused</code>.
     */
    public final TableField<ChangeDataPersonalVisitRecord, Long> COUNT_REFUSED = createField(DSL.name("count_refused"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>registration_change_address.change_data_personal_visit.count_records_edited</code>.
     * Записей гражданина отрекдактировано
     */
    public final TableField<ChangeDataPersonalVisitRecord, Long> COUNT_RECORDS_EDITED = createField(DSL.name("count_records_edited"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Записей гражданина отрекдактировано");

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

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

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

    /**
     * Create an aliased
     * <code>registration_change_address.change_data_personal_visit</code> table
     * reference
     */
    public ChangeDataPersonalVisit(Name alias) {
        this(alias, CHANGE_DATA_PERSONAL_VISIT);
    }

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

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

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

    @Override
    public UniqueKey<ChangeDataPersonalVisitRecord> getPrimaryKey() {
        return Keys.CHANGE_DATA_PERSONAL_VISIT_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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