/*
 * This file is generated by jOOQ.
 */
package ervu_dashboard.ervu_dashboard.db_beans.security.tables;


import ervu_dashboard.ervu_dashboard.db_beans.security.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.security.Security;
import ervu_dashboard.ervu_dashboard.db_beans.security.tables.UserGroup.UserGroupPath;
import ervu_dashboard.ervu_dashboard.db_beans.security.tables.UserRole.UserRolePath;
import ervu_dashboard.ervu_dashboard.db_beans.security.tables.records.LinkUserGroupUserRoleRecord;

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.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;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>security.link_user_group_user_role</code>
     */
    public static final LinkUserGroupUserRole LINK_USER_GROUP_USER_ROLE = new LinkUserGroupUserRole();

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

    /**
     * The column
     * <code>security.link_user_group_user_role.link_user_group_user_role_id</code>.
     */
    public final TableField<LinkUserGroupUserRoleRecord, String> LINK_USER_GROUP_USER_ROLE_ID = createField(DSL.name("link_user_group_user_role_id"), SQLDataType.CHAR(36).nullable(false), this, "");

    /**
     * The column <code>security.link_user_group_user_role.user_group_id</code>.
     */
    public final TableField<LinkUserGroupUserRoleRecord, String> USER_GROUP_ID = createField(DSL.name("user_group_id"), SQLDataType.CHAR(36).nullable(false), this, "");

    /**
     * The column <code>security.link_user_group_user_role.user_role_id</code>.
     */
    public final TableField<LinkUserGroupUserRoleRecord, String> USER_ROLE_ID = createField(DSL.name("user_role_id"), SQLDataType.CHAR(36).nullable(false), this, "");

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

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

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

    /**
     * Create an aliased <code>security.link_user_group_user_role</code> table
     * reference
     */
    public LinkUserGroupUserRole(String alias) {
        this(DSL.name(alias), LINK_USER_GROUP_USER_ROLE);
    }

    /**
     * Create an aliased <code>security.link_user_group_user_role</code> table
     * reference
     */
    public LinkUserGroupUserRole(Name alias) {
        this(alias, LINK_USER_GROUP_USER_ROLE);
    }

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

    public <O extends Record> LinkUserGroupUserRole(Table<O> path, ForeignKey<O, LinkUserGroupUserRoleRecord> childPath, InverseForeignKey<O, LinkUserGroupUserRoleRecord> parentPath) {
        super(path, childPath, parentPath, LINK_USER_GROUP_USER_ROLE);
    }

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

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

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

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

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

    @Override
    public UniqueKey<LinkUserGroupUserRoleRecord> getPrimaryKey() {
        return Keys.PK_GROUP_ROLE;
    }

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

    @Override
    public List<ForeignKey<LinkUserGroupUserRoleRecord, ?>> getReferences() {
        return Arrays.asList(Keys.LINK_USER_GROUP_USER_ROLE__FK_GROUP_ROLE_GROUP, Keys.LINK_USER_GROUP_USER_ROLE__FK_GROUP_ROLE_ROLE);
    }

    private transient UserGroupPath _userGroup;

    /**
     * Get the implicit join path to the <code>security.user_group</code> table.
     */
    public UserGroupPath userGroup() {
        if (_userGroup == null)
            _userGroup = new UserGroupPath(this, Keys.LINK_USER_GROUP_USER_ROLE__FK_GROUP_ROLE_GROUP, null);

        return _userGroup;
    }

    private transient UserRolePath _userRole;

    /**
     * Get the implicit join path to the <code>security.user_role</code> table.
     */
    public UserRolePath userRole() {
        if (_userRole == null)
            _userRole = new UserRolePath(this, Keys.LINK_USER_GROUP_USER_ROLE__FK_GROUP_ROLE_ROLE, null);

        return _userRole;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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