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


/**
 * Журналирование. Подписание УКЭП
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class SignJournal extends TableImpl<SignJournalRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>journal_log.sign_journal</code>
     */
    public static final SignJournal SIGN_JOURNAL = new SignJournal();

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

    /**
     * The column <code>journal_log.sign_journal.sign_journal_id</code>.
     */
    public final TableField<SignJournalRecord, Long> SIGN_JOURNAL_ID = createField(DSL.name("sign_journal_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column <code>journal_log.sign_journal.count_sign</code>.
     */
    public final TableField<SignJournalRecord, Long> COUNT_SIGN = createField(DSL.name("count_sign"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column <code>journal_log.sign_journal.count_cancel_sign</code>.
     */
    public final TableField<SignJournalRecord, Long> COUNT_CANCEL_SIGN = createField(DSL.name("count_cancel_sign"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private SignJournal(Name alias, Table<SignJournalRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Журналирование. Подписание УКЭП"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>journal_log.sign_journal</code> table reference
     */
    public SignJournal(Name alias) {
        this(alias, SIGN_JOURNAL);
    }

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

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

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

    @Override
    public UniqueKey<SignJournalRecord> getPrimaryKey() {
        return Keys.SIGN_JOURNAL_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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