/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu.account_applications.db_beans.public_.tables;


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

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Path;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.Record;
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.ervu.account_applications.db_beans.public_.Keys;
import ru.micord.ervu.account_applications.db_beans.public_.Public;
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationList.UserApplicationListPath;
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationRole.UserApplicationRolePath;
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.LinkUserApplicationUserApplicationUpdateRoleRecord;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>public.link_user_application_user_application_update_role</code>
     */
    public static final LinkUserApplicationUserApplicationUpdateRole LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE = new LinkUserApplicationUserApplicationUpdateRole();

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

    /**
     * The column
     * <code>public.link_user_application_user_application_update_role.link_user_application_user_update_role_id</code>.
     */
    public final TableField<LinkUserApplicationUserApplicationUpdateRoleRecord, Long> LINK_USER_APPLICATION_USER_UPDATE_ROLE_ID = createField(DSL.name("link_user_application_user_update_role_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>public.link_user_application_user_application_update_role.user_application_list_id</code>.
     */
    public final TableField<LinkUserApplicationUserApplicationUpdateRoleRecord, Long> USER_APPLICATION_LIST_ID = createField(DSL.name("user_application_list_id"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column
     * <code>public.link_user_application_user_application_update_role.user_update_role_id</code>.
     */
    public final TableField<LinkUserApplicationUserApplicationUpdateRoleRecord, String> USER_UPDATE_ROLE_ID = createField(DSL.name("user_update_role_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

    /**
     * The column
     * <code>public.link_user_application_user_application_update_role.created</code>.
     */
    public final TableField<LinkUserApplicationUserApplicationUpdateRoleRecord, Timestamp> CREATED = createField(DSL.name("created"), SQLDataType.TIMESTAMP(0).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");

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

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

    /**
     * Create an aliased
     * <code>public.link_user_application_user_application_update_role</code>
     * table reference
     */
    public LinkUserApplicationUserApplicationUpdateRole(String alias) {
        this(DSL.name(alias), LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE);
    }

    /**
     * Create an aliased
     * <code>public.link_user_application_user_application_update_role</code>
     * table reference
     */
    public LinkUserApplicationUserApplicationUpdateRole(Name alias) {
        this(alias, LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE);
    }

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

    public <O extends Record> LinkUserApplicationUserApplicationUpdateRole(Table<O> path, ForeignKey<O, LinkUserApplicationUserApplicationUpdateRoleRecord> childPath, InverseForeignKey<O, LinkUserApplicationUserApplicationUpdateRoleRecord> parentPath) {
        super(path, childPath, parentPath, LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class LinkUserApplicationUserApplicationUpdateRolePath extends LinkUserApplicationUserApplicationUpdateRole implements Path<LinkUserApplicationUserApplicationUpdateRoleRecord> {
        public <O extends Record> LinkUserApplicationUserApplicationUpdateRolePath(Table<O> path, ForeignKey<O, LinkUserApplicationUserApplicationUpdateRoleRecord> childPath, InverseForeignKey<O, LinkUserApplicationUserApplicationUpdateRoleRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private LinkUserApplicationUserApplicationUpdateRolePath(Name alias, Table<LinkUserApplicationUserApplicationUpdateRoleRecord> aliased) {
            super(alias, aliased);
        }

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

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

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

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

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

    @Override
    public UniqueKey<LinkUserApplicationUserApplicationUpdateRoleRecord> getPrimaryKey() {
        return Keys.PK_LINK_USER_APPLICATION_UPDATE_ROLE;
    }

    @Override
    public List<UniqueKey<LinkUserApplicationUserApplicationUpdateRoleRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.UNI_USER_APPLICATION_UPDATE_ROLE);
    }

    @Override
    public List<ForeignKey<LinkUserApplicationUserApplicationUpdateRoleRecord, ?>> getReferences() {
        return Arrays.asList(Keys.LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE__FK3_USER_APPLICATION_LIST, Keys.LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE__FK1_USER_ROLE);
    }

    private transient UserApplicationListPath _userApplicationList;

    /**
     * Get the implicit join path to the
     * <code>public.user_application_list</code> table.
     */
    public UserApplicationListPath userApplicationList() {
        if (_userApplicationList == null)
            _userApplicationList = new UserApplicationListPath(this, Keys.LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE__FK3_USER_APPLICATION_LIST, null);

        return _userApplicationList;
    }

    private transient UserApplicationRolePath _userApplicationRole;

    /**
     * Get the implicit join path to the
     * <code>public.user_application_role</code> table.
     */
    public UserApplicationRolePath userApplicationRole() {
        if (_userApplicationRole == null)
            _userApplicationRole = new UserApplicationRolePath(this, Keys.LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE__FK1_USER_ROLE, null);

        return _userApplicationRole;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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