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


/**
 * Первоначальная постановка на учет. Статусы решений по Первоначальной
 * постановке на учет(ЕПГУ)
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class StatusesDecisionsOnEpgu extends TableImpl<StatusesDecisionsOnEpguRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>init_registration_info.statuses_decisions_on_epgu</code>
     */
    public static final StatusesDecisionsOnEpgu STATUSES_DECISIONS_ON_EPGU = new StatusesDecisionsOnEpgu();

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

    /**
     * The column
     * <code>init_registration_info.statuses_decisions_on_epgu.statuses_decisions_on_epgu_id</code>.
     */
    public final TableField<StatusesDecisionsOnEpguRecord, Long> STATUSES_DECISIONS_ON_EPGU_ID = createField(DSL.name("statuses_decisions_on_epgu_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>init_registration_info.statuses_decisions_on_epgu.count_loaded</code>.
     */
    public final TableField<StatusesDecisionsOnEpguRecord, Long> COUNT_LOADED = createField(DSL.name("count_loaded"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>init_registration_info.statuses_decisions_on_epgu.count_signed</code>.
     */
    public final TableField<StatusesDecisionsOnEpguRecord, Long> COUNT_SIGNED = createField(DSL.name("count_signed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>init_registration_info.statuses_decisions_on_epgu.count_formed_for_signing</code>.
     */
    public final TableField<StatusesDecisionsOnEpguRecord, Long> COUNT_FORMED_FOR_SIGNING = createField(DSL.name("count_formed_for_signing"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private StatusesDecisionsOnEpgu(Name alias, Table<StatusesDecisionsOnEpguRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Первоначальная постановка на учет. Статусы решений по Первоначальной постановке на учет(ЕПГУ)"), TableOptions.table(), where);
    }

    /**
     * Create an aliased
     * <code>init_registration_info.statuses_decisions_on_epgu</code> table
     * reference
     */
    public StatusesDecisionsOnEpgu(String alias) {
        this(DSL.name(alias), STATUSES_DECISIONS_ON_EPGU);
    }

    /**
     * Create an aliased
     * <code>init_registration_info.statuses_decisions_on_epgu</code> table
     * reference
     */
    public StatusesDecisionsOnEpgu(Name alias) {
        this(alias, STATUSES_DECISIONS_ON_EPGU);
    }

    /**
     * Create a <code>init_registration_info.statuses_decisions_on_epgu</code>
     * table reference
     */
    public StatusesDecisionsOnEpgu() {
        this(DSL.name("statuses_decisions_on_epgu"), null);
    }

    public <O extends Record> StatusesDecisionsOnEpgu(Table<O> path, ForeignKey<O, StatusesDecisionsOnEpguRecord> childPath, InverseForeignKey<O, StatusesDecisionsOnEpguRecord> parentPath) {
        super(path, childPath, parentPath, STATUSES_DECISIONS_ON_EPGU);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<StatusesDecisionsOnEpguRecord> getPrimaryKey() {
        return Keys.STATUSES_DECISIONS_ON_EPGU_PKEY;
    }

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

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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