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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>idm_reconcile.role</code>
     */
    public static final Role ROLE = new Role();

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

    /**
     * The column <code>idm_reconcile.role.id</code>.
     */
    public final TableField<RoleRecord, String> ID = createField(DSL.name("id"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column <code>idm_reconcile.role.version</code>.
     */
    public final TableField<RoleRecord, Integer> VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>idm_reconcile.role.modified</code>.
     */
    public final TableField<RoleRecord, Timestamp> MODIFIED = createField(DSL.name("modified"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>idm_reconcile.role.schema</code>.
     */
    public final TableField<RoleRecord, String> SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column <code>idm_reconcile.role.name</code>.
     */
    public final TableField<RoleRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.role.shortname</code>.
     */
    public final TableField<RoleRecord, String> SHORTNAME = createField(DSL.name("shortname"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.role.display_name</code>.
     */
    public final TableField<RoleRecord, String> DISPLAY_NAME = createField(DSL.name("display_name"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.role.sessions_limit</code>.
     */
    public final TableField<RoleRecord, Integer> SESSIONS_LIMIT = createField(DSL.name("sessions_limit"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>idm_reconcile.role.ervu_role</code>.
     */
    public final TableField<RoleRecord, Boolean> ERVU_ROLE = createField(DSL.name("ervu_role"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>idm_reconcile.role.imported</code>.
     */
    public final TableField<RoleRecord, Integer> IMPORTED = createField(DSL.name("imported"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>idm_reconcile.role.description</code>.
     */
    public final TableField<RoleRecord, String> DESCRIPTION = createField(DSL.name("description"), SQLDataType.CLOB, this, "");

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

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

    /**
     * Create an aliased <code>idm_reconcile.role</code> table reference
     */
    public Role(String alias) {
        this(DSL.name(alias), ROLE);
    }

    /**
     * Create an aliased <code>idm_reconcile.role</code> table reference
     */
    public Role(Name alias) {
        this(alias, ROLE);
    }

    /**
     * Create a <code>idm_reconcile.role</code> table reference
     */
    public Role() {
        this(DSL.name("role"), null);
    }

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

    @Override
    public UniqueKey<RoleRecord> getPrimaryKey() {
        return Keys.ROLE_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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