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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>public.link_user_application_user_application_role</code>
     */
    public static final LinkUserApplicationUserApplicationRole LINK_USER_APPLICATION_USER_APPLICATION_ROLE = new LinkUserApplicationUserApplicationRole();

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

    /**
     * The column
     * <code>public.link_user_application_user_application_role.link_user_application_user_role_id</code>.
     */
    public final TableField<LinkUserApplicationUserApplicationRoleRecord, Long> LINK_USER_APPLICATION_USER_ROLE_ID = createField(DSL.name("link_user_application_user_role_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>public.link_user_application_user_application_role.user_application_list_id</code>.
     */
    public final TableField<LinkUserApplicationUserApplicationRoleRecord, 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_role.user_role_id</code>.
     */
    public final TableField<LinkUserApplicationUserApplicationRoleRecord, String> USER_ROLE_ID = createField(DSL.name("user_role_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

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

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

    private LinkUserApplicationUserApplicationRole(Name alias, Table<LinkUserApplicationUserApplicationRoleRecord> 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_role</code> table
     * reference
     */
    public LinkUserApplicationUserApplicationRole(String alias) {
        this(DSL.name(alias), LINK_USER_APPLICATION_USER_APPLICATION_ROLE);
    }

    /**
     * Create an aliased
     * <code>public.link_user_application_user_application_role</code> table
     * reference
     */
    public LinkUserApplicationUserApplicationRole(Name alias) {
        this(alias, LINK_USER_APPLICATION_USER_APPLICATION_ROLE);
    }

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

    public <O extends Record> LinkUserApplicationUserApplicationRole(Table<O> path, ForeignKey<O, LinkUserApplicationUserApplicationRoleRecord> childPath, InverseForeignKey<O, LinkUserApplicationUserApplicationRoleRecord> parentPath) {
        super(path, childPath, parentPath, LINK_USER_APPLICATION_USER_APPLICATION_ROLE);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<LinkUserApplicationUserApplicationRoleRecord> getPrimaryKey() {
        return Keys.PK_LINK_USER_APPLICATION_USER_APPLICATION_ROLE;
    }

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

    @Override
    public List<ForeignKey<LinkUserApplicationUserApplicationRoleRecord, ?>> getReferences() {
        return Arrays.asList(Keys.LINK_USER_APPLICATION_USER_APPLICATION_ROLE__FK_USER_APPLICATION_LIST, Keys.LINK_USER_APPLICATION_USER_APPLICATION_ROLE__FK_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_ROLE__FK_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_ROLE__FK_USER_ROLE, null);

        return _userApplicationRole;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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