/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.admin_indicators.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.admin_indicators.AdminIndicators;
import ru.micord.webbpm.ervu.business_metrics.db_beans.admin_indicators.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.admin_indicators.tables.records.UserActivityRecord;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class UserActivity extends TableImpl<UserActivityRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>admin_indicators.user_activity</code>
     */
    public static final UserActivity USER_ACTIVITY = new UserActivity();

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

    /**
     * The column <code>admin_indicators.user_activity.user_activity_id</code>.
     */
    public final TableField<UserActivityRecord, Long> USER_ACTIVITY_ID = createField(DSL.name("user_activity_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>admin_indicators.user_activity.count_user_activity</code>.
     * Количество активных пользователей
     */
    public final TableField<UserActivityRecord, Long> COUNT_USER_ACTIVITY = createField(DSL.name("count_user_activity"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Количество активных пользователей");

    /**
     * The column
     * <code>admin_indicators.user_activity.count_incorrect_authentications</code>.
     * Количество неверных аутентификаций
     */
    public final TableField<UserActivityRecord, Long> COUNT_INCORRECT_AUTHENTICATIONS = createField(DSL.name("count_incorrect_authentications"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "Количество неверных аутентификаций");

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

    private UserActivity(Name alias, Table<UserActivityRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>admin_indicators.user_activity</code> table
     * reference
     */
    public UserActivity(String alias) {
        this(DSL.name(alias), USER_ACTIVITY);
    }

    /**
     * Create an aliased <code>admin_indicators.user_activity</code> table
     * reference
     */
    public UserActivity(Name alias) {
        this(alias, USER_ACTIVITY);
    }

    /**
     * Create a <code>admin_indicators.user_activity</code> table reference
     */
    public UserActivity() {
        this(DSL.name("user_activity"), null);
    }

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

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

    @Override
    public UniqueKey<UserActivityRecord> getPrimaryKey() {
        return Keys.USER_ACTIVITY_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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