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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>public.link_user_application_update_ip_address</code>
     */
    public static final LinkUserApplicationUpdateIpAddress LINK_USER_APPLICATION_UPDATE_IP_ADDRESS = new LinkUserApplicationUpdateIpAddress();

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

    /**
     * The column
     * <code>public.link_user_application_update_ip_address.link_user_application_update_ip_address_id</code>.
     */
    public final TableField<LinkUserApplicationUpdateIpAddressRecord, Long> LINK_USER_APPLICATION_UPDATE_IP_ADDRESS_ID = createField(DSL.name("link_user_application_update_ip_address_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column
     * <code>public.link_user_application_update_ip_address.ip_address_update</code>.
     * ip адресс на изменение
     */
    public final TableField<LinkUserApplicationUpdateIpAddressRecord, String> IP_ADDRESS_UPDATE = createField(DSL.name("ip_address_update"), SQLDataType.VARCHAR.nullable(false), this, "ip адресс на изменение");

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

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

    /**
     * Create an aliased
     * <code>public.link_user_application_update_ip_address</code> table
     * reference
     */
    public LinkUserApplicationUpdateIpAddress(String alias) {
        this(DSL.name(alias), LINK_USER_APPLICATION_UPDATE_IP_ADDRESS);
    }

    /**
     * Create an aliased
     * <code>public.link_user_application_update_ip_address</code> table
     * reference
     */
    public LinkUserApplicationUpdateIpAddress(Name alias) {
        this(alias, LINK_USER_APPLICATION_UPDATE_IP_ADDRESS);
    }

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

    public <O extends Record> LinkUserApplicationUpdateIpAddress(Table<O> path, ForeignKey<O, LinkUserApplicationUpdateIpAddressRecord> childPath, InverseForeignKey<O, LinkUserApplicationUpdateIpAddressRecord> parentPath) {
        super(path, childPath, parentPath, LINK_USER_APPLICATION_UPDATE_IP_ADDRESS);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<LinkUserApplicationUpdateIpAddressRecord> getPrimaryKey() {
        return Keys.PK_LINK_USER_APPLICATION_UPDATE_IP_ADDRESS;
    }

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

    @Override
    public List<ForeignKey<LinkUserApplicationUpdateIpAddressRecord, ?>> getReferences() {
        return Arrays.asList(Keys.LINK_USER_APPLICATION_UPDATE_IP_ADDRESS__FK2_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_UPDATE_IP_ADDRESS__FK2_USER_APPLICATION_LIST, null);

        return _userApplicationList;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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