/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu.account_applications.db_beans.public_.tables;


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


/**
 * Таблица связи заявок и ip адрессов пользователя
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class LinkUserApplicationIpAddress extends TableImpl<LinkUserApplicationIpAddressRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>public.link_user_application_ip_address</code>
     */
    public static final LinkUserApplicationIpAddress LINK_USER_APPLICATION_IP_ADDRESS = new LinkUserApplicationIpAddress();

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

    /**
     * The column
     * <code>public.link_user_application_ip_address.link_user_application_ip_address_id</code>.
     */
    public final TableField<LinkUserApplicationIpAddressRecord, Long> LINK_USER_APPLICATION_IP_ADDRESS_ID = createField(DSL.name("link_user_application_ip_address_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>public.link_user_application_ip_address.user_application_list_id</code>.
     * Идентификатор списка заявок пользователя
     */
    public final TableField<LinkUserApplicationIpAddressRecord, Long> USER_APPLICATION_LIST_ID = createField(DSL.name("user_application_list_id"), SQLDataType.BIGINT.nullable(false), this, "Идентификатор списка заявок пользователя");

    /**
     * The column
     * <code>public.link_user_application_ip_address.ip_address</code>. ip
     * адресс
     */
    public final TableField<LinkUserApplicationIpAddressRecord, String> IP_ADDRESS = createField(DSL.name("ip_address"), SQLDataType.VARCHAR.nullable(false), this, "ip адресс");

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

    private LinkUserApplicationIpAddress(Name alias, Table<LinkUserApplicationIpAddressRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Таблица связи заявок и ip адрессов пользователя"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>public.link_user_application_ip_address</code>
     * table reference
     */
    public LinkUserApplicationIpAddress(String alias) {
        this(DSL.name(alias), LINK_USER_APPLICATION_IP_ADDRESS);
    }

    /**
     * Create an aliased <code>public.link_user_application_ip_address</code>
     * table reference
     */
    public LinkUserApplicationIpAddress(Name alias) {
        this(alias, LINK_USER_APPLICATION_IP_ADDRESS);
    }

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

    public <O extends Record> LinkUserApplicationIpAddress(Table<O> path, ForeignKey<O, LinkUserApplicationIpAddressRecord> childPath, InverseForeignKey<O, LinkUserApplicationIpAddressRecord> parentPath) {
        super(path, childPath, parentPath, LINK_USER_APPLICATION_IP_ADDRESS);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<LinkUserApplicationIpAddressRecord> getPrimaryKey() {
        return Keys.PK_LINK_USER_APPLICATION_IP_ADDRESS;
    }

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

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

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

        return _userApplicationList;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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