/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.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.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.Metrics;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.Recruitment.RecruitmentPath;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.records.IncidentsRecievedByDataFromGirVuRecord;


/**
 * Инциденты. Принятые решения на основании данных из ГИР ВУ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class IncidentsRecievedByDataFromGirVu extends TableImpl<IncidentsRecievedByDataFromGirVuRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>metrics.incidents_recieved_by_data_from_gir_vu</code>
     */
    public static final IncidentsRecievedByDataFromGirVu INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU = new IncidentsRecievedByDataFromGirVu();

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

    /**
     * The column
     * <code>metrics.incidents_recieved_by_data_from_gir_vu.incidents_recieved_by_data_from_gir_vu_id</code>.
     */
    public final TableField<IncidentsRecievedByDataFromGirVuRecord, Long> INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU_ID = createField(DSL.name("incidents_recieved_by_data_from_gir_vu_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>metrics.incidents_recieved_by_data_from_gir_vu.count_confirmed</code>.
     */
    public final TableField<IncidentsRecievedByDataFromGirVuRecord, Long> COUNT_CONFIRMED = createField(DSL.name("count_confirmed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.incidents_recieved_by_data_from_gir_vu.count_not_confirmed</code>.
     */
    public final TableField<IncidentsRecievedByDataFromGirVuRecord, Long> COUNT_NOT_CONFIRMED = createField(DSL.name("count_not_confirmed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private IncidentsRecievedByDataFromGirVu(Name alias, Table<IncidentsRecievedByDataFromGirVuRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Инциденты. Принятые решения на основании данных из ГИР ВУ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased
     * <code>metrics.incidents_recieved_by_data_from_gir_vu</code> table
     * reference
     */
    public IncidentsRecievedByDataFromGirVu(String alias) {
        this(DSL.name(alias), INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU);
    }

    /**
     * Create an aliased
     * <code>metrics.incidents_recieved_by_data_from_gir_vu</code> table
     * reference
     */
    public IncidentsRecievedByDataFromGirVu(Name alias) {
        this(alias, INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU);
    }

    /**
     * Create a <code>metrics.incidents_recieved_by_data_from_gir_vu</code>
     * table reference
     */
    public IncidentsRecievedByDataFromGirVu() {
        this(DSL.name("incidents_recieved_by_data_from_gir_vu"), null);
    }

    public <O extends Record> IncidentsRecievedByDataFromGirVu(Table<O> path, ForeignKey<O, IncidentsRecievedByDataFromGirVuRecord> childPath, InverseForeignKey<O, IncidentsRecievedByDataFromGirVuRecord> parentPath) {
        super(path, childPath, parentPath, INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<IncidentsRecievedByDataFromGirVuRecord> getPrimaryKey() {
        return Keys.INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU_PKEY;
    }

    @Override
    public List<ForeignKey<IncidentsRecievedByDataFromGirVuRecord, ?>> getReferences() {
        return Arrays.asList(Keys.INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU__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.INCIDENTS_RECIEVED_BY_DATA_FROM_GIR_VU__FK_CRIMINAL_ADMINISTRATIVE_LIABILITY_RECRUITMENT_ID, null);

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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