/*
 * 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.UserAccount.UserAccountPath;
import ervu_dashboard.ervu_dashboard.db_beans.security.tables.UserGroup.UserGroupPath;
import ervu_dashboard.ervu_dashboard.db_beans.security.tables.records.LinkUserAccountUserGroupRecord;

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 LinkUserAccountUserGroup extends TableImpl<LinkUserAccountUserGroupRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>security.link_user_account_user_group</code>
     */
    public static final LinkUserAccountUserGroup LINK_USER_ACCOUNT_USER_GROUP = new LinkUserAccountUserGroup();

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

    /**
     * The column
     * <code>security.link_user_account_user_group.link_user_account_user_group_id</code>.
     */
    public final TableField<LinkUserAccountUserGroupRecord, String> LINK_USER_ACCOUNT_USER_GROUP_ID = createField(DSL.name("link_user_account_user_group_id"), SQLDataType.CHAR(36).nullable(false), this, "");

    /**
     * The column
     * <code>security.link_user_account_user_group.user_account_id</code>.
     */
    public final TableField<LinkUserAccountUserGroupRecord, String> USER_ACCOUNT_ID = createField(DSL.name("user_account_id"), SQLDataType.VARCHAR(150).nullable(false), this, "");

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

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

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

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

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

    /**
     * Create an aliased <code>security.link_user_account_user_group</code>
     * table reference
     */
    public LinkUserAccountUserGroup(Name alias) {
        this(alias, LINK_USER_ACCOUNT_USER_GROUP);
    }

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

    public <O extends Record> LinkUserAccountUserGroup(Table<O> path, ForeignKey<O, LinkUserAccountUserGroupRecord> childPath, InverseForeignKey<O, LinkUserAccountUserGroupRecord> parentPath) {
        super(path, childPath, parentPath, LINK_USER_ACCOUNT_USER_GROUP);
    }

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

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

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

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

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

    @Override
    public UniqueKey<LinkUserAccountUserGroupRecord> getPrimaryKey() {
        return Keys.PK_USER_GROUP;
    }

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

    @Override
    public List<ForeignKey<LinkUserAccountUserGroupRecord, ?>> getReferences() {
        return Arrays.asList(Keys.LINK_USER_ACCOUNT_USER_GROUP__FK_USER_GROUP_USER, Keys.LINK_USER_ACCOUNT_USER_GROUP__FK_USER_GROUP_GROUP);
    }

    private transient UserAccountPath _userAccount;

    /**
     * Get the implicit join path to the <code>security.user_account</code>
     * table.
     */
    public UserAccountPath userAccount() {
        if (_userAccount == null)
            _userAccount = new UserAccountPath(this, Keys.LINK_USER_ACCOUNT_USER_GROUP__FK_USER_GROUP_USER, null);

        return _userAccount;
    }

    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_ACCOUNT_USER_GROUP__FK_USER_GROUP_GROUP, null);

        return _userGroup;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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