/*
 * 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.Authority.AuthorityPath;
import ervu_dashboard.ervu_dashboard.db_beans.security.tables.UserRole.UserRolePath;
import ervu_dashboard.ervu_dashboard.db_beans.security.tables.records.LinkUserRoleAuthorityRecord;

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 LinkUserRoleAuthority extends TableImpl<LinkUserRoleAuthorityRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>security.link_user_role_authority</code>
     */
    public static final LinkUserRoleAuthority LINK_USER_ROLE_AUTHORITY = new LinkUserRoleAuthority();

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

    /**
     * The column
     * <code>security.link_user_role_authority.user_role_authority_id</code>.
     */
    public final TableField<LinkUserRoleAuthorityRecord, String> USER_ROLE_AUTHORITY_ID = createField(DSL.name("user_role_authority_id"), SQLDataType.CHAR(36).nullable(false), this, "");

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

    /**
     * The column <code>security.link_user_role_authority.authority_id</code>.
     */
    public final TableField<LinkUserRoleAuthorityRecord, String> AUTHORITY_ID = createField(DSL.name("authority_id"), SQLDataType.CHAR(36).nullable(false), this, "");

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

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

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

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

    /**
     * Create an aliased <code>security.link_user_role_authority</code> table
     * reference
     */
    public LinkUserRoleAuthority(Name alias) {
        this(alias, LINK_USER_ROLE_AUTHORITY);
    }

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

    public <O extends Record> LinkUserRoleAuthority(Table<O> path, ForeignKey<O, LinkUserRoleAuthorityRecord> childPath, InverseForeignKey<O, LinkUserRoleAuthorityRecord> parentPath) {
        super(path, childPath, parentPath, LINK_USER_ROLE_AUTHORITY);
    }

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

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

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

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

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

    @Override
    public UniqueKey<LinkUserRoleAuthorityRecord> getPrimaryKey() {
        return Keys.PK_ROLE_AUTHORITY;
    }

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

    @Override
    public List<ForeignKey<LinkUserRoleAuthorityRecord, ?>> getReferences() {
        return Arrays.asList(Keys.LINK_USER_ROLE_AUTHORITY__FK_ROLE_AUTHORITY_ROLE, Keys.LINK_USER_ROLE_AUTHORITY__FK_ROLE_AUTHORITY_AUTHORITY);
    }

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

        return _userRole;
    }

    private transient AuthorityPath _authority;

    /**
     * Get the implicit join path to the <code>security.authority</code> table.
     */
    public AuthorityPath authority() {
        if (_authority == null)
            _authority = new AuthorityPath(this, Keys.LINK_USER_ROLE_AUTHORITY__FK_ROLE_AUTHORITY_AUTHORITY, null);

        return _authority;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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