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


/**
 * Журналирование. Обмен данными с реестром повесток
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class SummonsesListDataExchange extends TableImpl<SummonsesListDataExchangeRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>journal_log.summonses_list_data_exchange</code>
     */
    public static final SummonsesListDataExchange SUMMONSES_LIST_DATA_EXCHANGE = new SummonsesListDataExchange();

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

    /**
     * The column
     * <code>journal_log.summonses_list_data_exchange.summonses_list_data_exchange_id</code>.
     */
    public final TableField<SummonsesListDataExchangeRecord, Long> SUMMONSES_LIST_DATA_EXCHANGE_ID = createField(DSL.name("summonses_list_data_exchange_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>journal_log.summonses_list_data_exchange.count_entry_system</code>.
     * вход в систему
     */
    public final TableField<SummonsesListDataExchangeRecord, Long> COUNT_ENTRY_SYSTEM = createField(DSL.name("count_entry_system"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "вход в систему");

    /**
     * The column
     * <code>journal_log.summonses_list_data_exchange.count_entry_system_error</code>.
     * вход в систему с ошибкой
     */
    public final TableField<SummonsesListDataExchangeRecord, Long> COUNT_ENTRY_SYSTEM_ERROR = createField(DSL.name("count_entry_system_error"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "вход в систему с ошибкой");

    /**
     * The column
     * <code>journal_log.summonses_list_data_exchange.count_request_extract</code>.
     * запрос выписки
     */
    public final TableField<SummonsesListDataExchangeRecord, Long> COUNT_REQUEST_EXTRACT = createField(DSL.name("count_request_extract"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "запрос выписки");

    /**
     * The column
     * <code>journal_log.summonses_list_data_exchange.count_request_extract_error</code>.
     * запрос выписки с ошибкой
     */
    public final TableField<SummonsesListDataExchangeRecord, Long> COUNT_REQUEST_EXTRACT_ERROR = createField(DSL.name("count_request_extract_error"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "запрос выписки с ошибкой");

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

    private SummonsesListDataExchange(Name alias, Table<SummonsesListDataExchangeRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Журналирование. Обмен данными с реестром повесток"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>journal_log.summonses_list_data_exchange</code>
     * table reference
     */
    public SummonsesListDataExchange(String alias) {
        this(DSL.name(alias), SUMMONSES_LIST_DATA_EXCHANGE);
    }

    /**
     * Create an aliased <code>journal_log.summonses_list_data_exchange</code>
     * table reference
     */
    public SummonsesListDataExchange(Name alias) {
        this(alias, SUMMONSES_LIST_DATA_EXCHANGE);
    }

    /**
     * Create a <code>journal_log.summonses_list_data_exchange</code> table
     * reference
     */
    public SummonsesListDataExchange() {
        this(DSL.name("summonses_list_data_exchange"), null);
    }

    public <O extends Record> SummonsesListDataExchange(Table<O> path, ForeignKey<O, SummonsesListDataExchangeRecord> childPath, InverseForeignKey<O, SummonsesListDataExchangeRecord> parentPath) {
        super(path, childPath, parentPath, SUMMONSES_LIST_DATA_EXCHANGE);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<SummonsesListDataExchangeRecord> getPrimaryKey() {
        return Keys.SUMMONSES_LIST_DATA_EXCHANGE_PKEY;
    }

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

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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