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


import java.sql.Date;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Path;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.Record;
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.metrics.tables.Recruitment.RecruitmentPath;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list_subsystem.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list_subsystem.SummonsesListSubsystem;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list_subsystem.tables.records.SummonsesDirectToPersAccRecord;


/**
 * Реестр повесток подсистема. Направление повесток в ЛК РП
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class SummonsesDirectToPersAcc extends TableImpl<SummonsesDirectToPersAccRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc</code>
     */
    public static final SummonsesDirectToPersAcc SUMMONSES_DIRECT_TO_PERS_ACC = new SummonsesDirectToPersAcc();

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

    /**
     * The column
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc.summonses_direct_to_pers_acc_id</code>.
     */
    public final TableField<SummonsesDirectToPersAccRecord, Long> SUMMONSES_DIRECT_TO_PERS_ACC_ID = createField(DSL.name("summonses_direct_to_pers_acc_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc.count_draft_board</code>.
     */
    public final TableField<SummonsesDirectToPersAccRecord, Long> COUNT_DRAFT_BOARD = createField(DSL.name("count_draft_board"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc.count_recruitment_company</code>.
     */
    public final TableField<SummonsesDirectToPersAccRecord, Long> COUNT_RECRUITMENT_COMPANY = createField(DSL.name("count_recruitment_company"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc.count_military_registration</code>.
     */
    public final TableField<SummonsesDirectToPersAccRecord, Long> COUNT_MILITARY_REGISTRATION = createField(DSL.name("count_military_registration"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc.count_mobilisation</code>.
     */
    public final TableField<SummonsesDirectToPersAccRecord, Long> COUNT_MOBILISATION = createField(DSL.name("count_mobilisation"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private SummonsesDirectToPersAcc(Name alias, Table<SummonsesDirectToPersAccRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Реестр повесток подсистема. Направление повесток в ЛК РП"), TableOptions.table(), where);
    }

    /**
     * Create an aliased
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc</code> table
     * reference
     */
    public SummonsesDirectToPersAcc(String alias) {
        this(DSL.name(alias), SUMMONSES_DIRECT_TO_PERS_ACC);
    }

    /**
     * Create an aliased
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc</code> table
     * reference
     */
    public SummonsesDirectToPersAcc(Name alias) {
        this(alias, SUMMONSES_DIRECT_TO_PERS_ACC);
    }

    /**
     * Create a
     * <code>summonses_list_subsystem.summonses_direct_to_pers_acc</code> table
     * reference
     */
    public SummonsesDirectToPersAcc() {
        this(DSL.name("summonses_direct_to_pers_acc"), null);
    }

    public <O extends Record> SummonsesDirectToPersAcc(Table<O> path, ForeignKey<O, SummonsesDirectToPersAccRecord> childPath, InverseForeignKey<O, SummonsesDirectToPersAccRecord> parentPath) {
        super(path, childPath, parentPath, SUMMONSES_DIRECT_TO_PERS_ACC);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class SummonsesDirectToPersAccPath extends SummonsesDirectToPersAcc implements Path<SummonsesDirectToPersAccRecord> {
        public <O extends Record> SummonsesDirectToPersAccPath(Table<O> path, ForeignKey<O, SummonsesDirectToPersAccRecord> childPath, InverseForeignKey<O, SummonsesDirectToPersAccRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private SummonsesDirectToPersAccPath(Name alias, Table<SummonsesDirectToPersAccRecord> aliased) {
            super(alias, aliased);
        }

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

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

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

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

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

    @Override
    public UniqueKey<SummonsesDirectToPersAccRecord> getPrimaryKey() {
        return Keys.SUMMONSES_DIRECT_TO_PERS_ACC_PKEY;
    }

    @Override
    public List<ForeignKey<SummonsesDirectToPersAccRecord, ?>> getReferences() {
        return Arrays.asList(Keys.SUMMONSES_DIRECT_TO_PERS_ACC__FK_CRIMINAL_ADMINISTRATIVE_LIABILITY_RECRUITMENT_ID);
    }

    private transient RecruitmentPath _recruitment;

    /**
     * Get the implicit join path to the <code>metrics.recruitment</code> table.
     */
    public RecruitmentPath recruitment() {
        if (_recruitment == null)
            _recruitment = new RecruitmentPath(this, Keys.SUMMONSES_DIRECT_TO_PERS_ACC__FK_CRIMINAL_ADMINISTRATIVE_LIABILITY_RECRUITMENT_ID, null);

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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