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


/**
 * Журналирование. Транзакции с внешними систиемами
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ExternalSystemTransaction extends TableImpl<ExternalSystemTransactionRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>journal_log.external_system_transaction</code>
     */
    public static final ExternalSystemTransaction EXTERNAL_SYSTEM_TRANSACTION = new ExternalSystemTransaction();

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

    /**
     * The column
     * <code>journal_log.external_system_transaction.external_system_transaction_id</code>.
     */
    public final TableField<ExternalSystemTransactionRecord, Long> EXTERNAL_SYSTEM_TRANSACTION_ID = createField(DSL.name("external_system_transaction_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column <code>journal_log.external_system_transaction.count_in</code>.
     * вх сообщения
     */
    public final TableField<ExternalSystemTransactionRecord, Long> COUNT_IN = createField(DSL.name("count_in"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "вх сообщения");

    /**
     * The column
     * <code>journal_log.external_system_transaction.count_out</code>. исх
     * сообщения
     */
    public final TableField<ExternalSystemTransactionRecord, Long> COUNT_OUT = createField(DSL.name("count_out"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "исх сообщения");

    /**
     * The column
     * <code>journal_log.external_system_transaction.count_formed</code>.
     * сформированные сообщения
     */
    public final TableField<ExternalSystemTransactionRecord, Long> COUNT_FORMED = createField(DSL.name("count_formed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "сформированные сообщения");

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

    private ExternalSystemTransaction(Name alias, Table<ExternalSystemTransactionRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Журналирование. Транзакции с внешними систиемами"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>journal_log.external_system_transaction</code>
     * table reference
     */
    public ExternalSystemTransaction(Name alias) {
        this(alias, EXTERNAL_SYSTEM_TRANSACTION);
    }

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

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

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

    @Override
    public UniqueKey<ExternalSystemTransactionRecord> getPrimaryKey() {
        return Keys.EXTERNAL_SYSTEM_TRANSACTION_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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