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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>journal_log.processed_records</code>
     */
    public static final ProcessedRecords PROCESSED_RECORDS = new ProcessedRecords();

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

    /**
     * The column
     * <code>journal_log.processed_records.processed_records_id</code>.
     */
    public final TableField<ProcessedRecordsRecord, Long> PROCESSED_RECORDS_ID = createField(DSL.name("processed_records_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column <code>journal_log.processed_records.count_flk_error</code>.
     * ошибки ФЛК
     */
    public final TableField<ProcessedRecordsRecord, Long> COUNT_FLK_ERROR = createField(DSL.name("count_flk_error"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "ошибки ФЛК");

    /**
     * The column <code>journal_log.processed_records.count_time_error</code>.
     * ошибки времени
     */
    public final TableField<ProcessedRecordsRecord, Long> COUNT_TIME_ERROR = createField(DSL.name("count_time_error"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "ошибки времени");

    /**
     * The column <code>journal_log.processed_records.count_new</code>. новые
     * записи
     */
    public final TableField<ProcessedRecordsRecord, Long> COUNT_NEW = createField(DSL.name("count_new"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "новые записи");

    /**
     * The column <code>journal_log.processed_records.count_actual</code>.
     * актуализированные записи
     */
    public final TableField<ProcessedRecordsRecord, Long> COUNT_ACTUAL = createField(DSL.name("count_actual"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "актуализированные записи");

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

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

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

    /**
     * Create an aliased <code>journal_log.processed_records</code> table
     * reference
     */
    public ProcessedRecords(Name alias) {
        this(alias, PROCESSED_RECORDS);
    }

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

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

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

    @Override
    public UniqueKey<ProcessedRecordsRecord> getPrimaryKey() {
        return Keys.PROCESSED_RECORDS_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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