/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.auth.tables;


import java.sql.Timestamp;
import java.util.Collection;

import org.jooq.Condition;
import org.jooq.Field;
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.auth.Auth;
import ru.micord.webbpm.ervu.business_metrics.db_beans.auth.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.auth.tables.records.FailedAuthRecord;


/**
 * События неуспешной аутентификации
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class FailedAuth extends TableImpl<FailedAuthRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>auth.failed_auth</code>
     */
    public static final FailedAuth FAILED_AUTH = new FailedAuth();

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

    /**
     * The column <code>auth.failed_auth.id</code>. Идентификатор события
     */
    public final TableField<FailedAuthRecord, String> ID = createField(DSL.name("id"), SQLDataType.VARCHAR(128).nullable(false), this, "Идентификатор события");

    /**
     * The column <code>auth.failed_auth.user_id</code>. Идентификатор
     * пользователя
     */
    public final TableField<FailedAuthRecord, String> USER_ID = createField(DSL.name("user_id"), SQLDataType.VARCHAR(128).nullable(false), this, "Идентификатор пользователя");

    /**
     * The column <code>auth.failed_auth.datetime</code>. Дата и время события
     */
    public final TableField<FailedAuthRecord, Timestamp> DATETIME = createField(DSL.name("datetime"), SQLDataType.TIMESTAMP(0), this, "Дата и время события");

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

    private FailedAuth(Name alias, Table<FailedAuthRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("События неуспешной аутентификации"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>auth.failed_auth</code> table reference
     */
    public FailedAuth(String alias) {
        this(DSL.name(alias), FAILED_AUTH);
    }

    /**
     * Create an aliased <code>auth.failed_auth</code> table reference
     */
    public FailedAuth(Name alias) {
        this(alias, FAILED_AUTH);
    }

    /**
     * Create a <code>auth.failed_auth</code> table reference
     */
    public FailedAuth() {
        this(DSL.name("failed_auth"), null);
    }

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

    @Override
    public UniqueKey<FailedAuthRecord> getPrimaryKey() {
        return Keys.FAILED_AUTH_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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