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

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 EsiaUser extends TableImpl<EsiaUserRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>security.esia_user</code>
     */
    public static final EsiaUser ESIA_USER = new EsiaUser();

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

    /**
     * The column <code>security.esia_user.esia_user_id</code>.
     */
    public final TableField<EsiaUserRecord, String> ESIA_USER_ID = createField(DSL.name("esia_user_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

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

    /**
     * The column <code>security.esia_user.person_contact_id</code>.
     */
    public final TableField<EsiaUserRecord, Long> PERSON_CONTACT_ID = createField(DSL.name("person_contact_id"), SQLDataType.BIGINT.nullable(false), this, "");

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

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

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

    /**
     * Create an aliased <code>security.esia_user</code> table reference
     */
    public EsiaUser(Name alias) {
        this(alias, ESIA_USER);
    }

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

    public <O extends Record> EsiaUser(Table<O> path, ForeignKey<O, EsiaUserRecord> childPath, InverseForeignKey<O, EsiaUserRecord> parentPath) {
        super(path, childPath, parentPath, ESIA_USER);
    }

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

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

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

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

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

    @Override
    public UniqueKey<EsiaUserRecord> getPrimaryKey() {
        return Keys.PK_ESIA_USER;
    }

    @Override
    public List<UniqueKey<EsiaUserRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.UNI_ESIA_USER1, Keys.UNI_ESIA_USER2);
    }

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

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

        return _userAccount;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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