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


import java.sql.Date;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.UUID;

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.LinkUserApplicationIpAddress.LinkUserApplicationIpAddressPath;
import ru.micord.ervu.account_applications.db_beans.public_.tables.LinkUserApplicationUpdateIpAddress.LinkUserApplicationUpdateIpAddressPath;
import ru.micord.ervu.account_applications.db_beans.public_.tables.LinkUserApplicationUserApplicationRole.LinkUserApplicationUserApplicationRolePath;
import ru.micord.ervu.account_applications.db_beans.public_.tables.LinkUserApplicationUserApplicationUpdateRole.LinkUserApplicationUserApplicationUpdateRolePath;
import ru.micord.ervu.account_applications.db_beans.public_.tables.UserApplicationRole.UserApplicationRolePath;
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.UserApplicationListRecord;


/**
 * Список заявок пользователя
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class UserApplicationList extends TableImpl<UserApplicationListRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.user_application_list</code>
     */
    public static final UserApplicationList USER_APPLICATION_LIST = new UserApplicationList();

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

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

    /**
     * The column <code>public.user_application_list.application_kind</code>.
     * Вид заявки
     */
    public final TableField<UserApplicationListRecord, String> APPLICATION_KIND = createField(DSL.name("application_kind"), SQLDataType.VARCHAR(100).nullable(false), this, "Вид заявки");

    /**
     * The column <code>public.user_application_list.user_login</code>. Логин
     * пользователя
     */
    public final TableField<UserApplicationListRecord, String> USER_LOGIN = createField(DSL.name("user_login"), SQLDataType.VARCHAR(100).nullable(false), this, "Логин пользователя");

    /**
     * The column <code>public.user_application_list.user_password</code>.
     * Пароль
     */
    public final TableField<UserApplicationListRecord, String> USER_PASSWORD = createField(DSL.name("user_password"), SQLDataType.VARCHAR(100), this, "Пароль");

    /**
     * The column <code>public.user_application_list.secondname</code>. Фамилия
     */
    public final TableField<UserApplicationListRecord, String> SECONDNAME = createField(DSL.name("secondname"), SQLDataType.VARCHAR(1000).nullable(false), this, "Фамилия");

    /**
     * The column <code>public.user_application_list.firstname</code>. Имя
     */
    public final TableField<UserApplicationListRecord, String> FIRSTNAME = createField(DSL.name("firstname"), SQLDataType.VARCHAR(1000).nullable(false), this, "Имя");

    /**
     * The column <code>public.user_application_list.middlename</code>. Отчество
     */
    public final TableField<UserApplicationListRecord, String> MIDDLENAME = createField(DSL.name("middlename"), SQLDataType.VARCHAR(1000), this, "Отчество");

    /**
     * The column <code>public.user_application_list.phone</code>. Телефон
     */
    public final TableField<UserApplicationListRecord, String> PHONE = createField(DSL.name("phone"), SQLDataType.VARCHAR(20), this, "Телефон");

    /**
     * The column <code>public.user_application_list.start_date</code>. Дата
     * создания
     */
    public final TableField<UserApplicationListRecord, Timestamp> START_DATE = createField(DSL.name("start_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "Дата создания");

    /**
     * The column <code>public.user_application_list.close_date</code>. Дата
     * закрытия
     */
    public final TableField<UserApplicationListRecord, Timestamp> CLOSE_DATE = createField(DSL.name("close_date"), SQLDataType.TIMESTAMP(0), this, "Дата закрытия");

    /**
     * The column <code>public.user_application_list.user_status</code>. Статус
     * пользователя
     */
    public final TableField<UserApplicationListRecord, String> USER_STATUS = createField(DSL.name("user_status"), SQLDataType.VARCHAR(50), this, "Статус пользователя");

    /**
     * The column <code>public.user_application_list.application_status</code>.
     * Вид заявки
     */
    public final TableField<UserApplicationListRecord, String> APPLICATION_STATUS = createField(DSL.name("application_status"), SQLDataType.VARCHAR(100).nullable(false), this, "Вид заявки");

    /**
     * The column <code>public.user_application_list.comment</code>. Примечание
     */
    public final TableField<UserApplicationListRecord, String> COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR, this, "Примечание");

    /**
     * The column <code>public.user_application_list.job_position_id</code>.
     * Идентификатор должности
     */
    public final TableField<UserApplicationListRecord, Long> JOB_POSITION_ID = createField(DSL.name("job_position_id"), SQLDataType.BIGINT, this, "Идентификатор должности");

    /**
     * The column <code>public.user_application_list.user_role_id</code>.
     * Идентификатор роли пользователя
     */
    public final TableField<UserApplicationListRecord, Long> USER_ROLE_ID = createField(DSL.name("user_role_id"), SQLDataType.BIGINT, this, "Идентификатор роли пользователя");

    /**
     * The column <code>public.user_application_list.recruitment_id</code>.
     * Организация
     */
    public final TableField<UserApplicationListRecord, UUID> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.UUID, this, "Организация");

    /**
     * The column <code>public.user_application_list.user_account_id</code>.
     * Идентификатор учетной записи пользователя
     */
    public final TableField<UserApplicationListRecord, String> USER_ACCOUNT_ID = createField(DSL.name("user_account_id"), SQLDataType.VARCHAR, this, "Идентификатор учетной записи пользователя");

    /**
     * The column <code>public.user_application_list.sex</code>. Пол
     */
    public final TableField<UserApplicationListRecord, String> SEX = createField(DSL.name("sex"), SQLDataType.VARCHAR, this, "Пол");

    /**
     * The column <code>public.user_application_list.birth_date</code>. Дата
     * рождения
     */
    public final TableField<UserApplicationListRecord, Date> BIRTH_DATE = createField(DSL.name("birth_date"), SQLDataType.DATE, this, "Дата рождения");

    /**
     * The column <code>public.user_application_list.snils</code>. СНИЛС
     */
    public final TableField<UserApplicationListRecord, String> SNILS = createField(DSL.name("snils"), SQLDataType.VARCHAR, this, "СНИЛС");

    /**
     * The column <code>public.user_application_list.job_position</code>.
     * Должность
     */
    public final TableField<UserApplicationListRecord, String> JOB_POSITION = createField(DSL.name("job_position"), SQLDataType.VARCHAR, this, "Должность");

    /**
     * The column <code>public.user_application_list.number_app</code>. Номер
     * заявки
     */
    public final TableField<UserApplicationListRecord, Long> NUMBER_APP = createField(DSL.name("number_app"), SQLDataType.BIGINT.nullable(false).identity(true), this, "Номер заявки");

    /**
     * The column <code>public.user_application_list.edit_comment</code>.
     * Примечание по изменениям
     */
    public final TableField<UserApplicationListRecord, String> EDIT_COMMENT = createField(DSL.name("edit_comment"), SQLDataType.VARCHAR, this, "Примечание по изменениям");

    /**
     * The column <code>public.user_application_list.person_id</code>. ссылка на
     * персональные данные
     */
    public final TableField<UserApplicationListRecord, String> PERSON_ID = createField(DSL.name("person_id"), SQLDataType.VARCHAR, this, "ссылка на персональные данные");

    /**
     * The column <code>public.user_application_list.update_secondname</code>.
     * Фамилия на изменение
     */
    public final TableField<UserApplicationListRecord, String> UPDATE_SECONDNAME = createField(DSL.name("update_secondname"), SQLDataType.VARCHAR(1000), this, "Фамилия на изменение");

    /**
     * The column <code>public.user_application_list.update_firstname</code>.
     * Имя на изменение
     */
    public final TableField<UserApplicationListRecord, String> UPDATE_FIRSTNAME = createField(DSL.name("update_firstname"), SQLDataType.VARCHAR(1000), this, "Имя на изменение");

    /**
     * The column <code>public.user_application_list.update_middlename</code>.
     * Отчество на изменение
     */
    public final TableField<UserApplicationListRecord, String> UPDATE_MIDDLENAME = createField(DSL.name("update_middlename"), SQLDataType.VARCHAR(1000), this, "Отчество на изменение");

    /**
     * The column <code>public.user_application_list.update_sex</code>. Пол на
     * изменение
     */
    public final TableField<UserApplicationListRecord, String> UPDATE_SEX = createField(DSL.name("update_sex"), SQLDataType.VARCHAR, this, "Пол на изменение");

    /**
     * The column <code>public.user_application_list.update_birth_date</code>.
     * Дата рождения на изменение
     */
    public final TableField<UserApplicationListRecord, Date> UPDATE_BIRTH_DATE = createField(DSL.name("update_birth_date"), SQLDataType.DATE, this, "Дата рождения на изменение");

    /**
     * The column <code>public.user_application_list.update_job_position</code>.
     * Должность на изменение
     */
    public final TableField<UserApplicationListRecord, String> UPDATE_JOB_POSITION = createField(DSL.name("update_job_position"), SQLDataType.VARCHAR, this, "Должность на изменение");

    /**
     * The column <code>public.user_application_list.trace_id</code>.
     * Идентификатор процесса
     */
    public final TableField<UserApplicationListRecord, String> TRACE_ID = createField(DSL.name("trace_id"), SQLDataType.VARCHAR(36), this, "Идентификатор процесса");

    /**
     * The column <code>public.user_application_list.sent_date</code>. Дата
     * отправки заявки в ЕРВУ
     */
    public final TableField<UserApplicationListRecord, Timestamp> SENT_DATE = createField(DSL.name("sent_date"), SQLDataType.TIMESTAMP(0), this, "Дата отправки заявки в ЕРВУ");

    /**
     * The column <code>public.user_application_list.blocked_region</code>.
     * Заблокированная область (ACCOUNT, PERSON или BOTH)
     */
    public final TableField<UserApplicationListRecord, String> BLOCKED_REGION = createField(DSL.name("blocked_region"), SQLDataType.VARCHAR(7), this, "Заблокированная область (ACCOUNT, PERSON или BOTH)");

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

    private UserApplicationList(Name alias, Table<UserApplicationListRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Список заявок пользователя"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>public.user_application_list</code> table
     * reference
     */
    public UserApplicationList(String alias) {
        this(DSL.name(alias), USER_APPLICATION_LIST);
    }

    /**
     * Create an aliased <code>public.user_application_list</code> table
     * reference
     */
    public UserApplicationList(Name alias) {
        this(alias, USER_APPLICATION_LIST);
    }

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

    public <O extends Record> UserApplicationList(Table<O> path, ForeignKey<O, UserApplicationListRecord> childPath, InverseForeignKey<O, UserApplicationListRecord> parentPath) {
        super(path, childPath, parentPath, USER_APPLICATION_LIST);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<UserApplicationListRecord> getPrimaryKey() {
        return Keys.PK_USER_APPLICATION_LIST;
    }

    private transient LinkUserApplicationIpAddressPath _linkUserApplicationIpAddress;

    /**
     * Get the implicit to-many join path to the
     * <code>public.link_user_application_ip_address</code> table
     */
    public LinkUserApplicationIpAddressPath linkUserApplicationIpAddress() {
        if (_linkUserApplicationIpAddress == null)
            _linkUserApplicationIpAddress = new LinkUserApplicationIpAddressPath(this, null, Keys.LINK_USER_APPLICATION_IP_ADDRESS__FK1_USER_APPLICATION_LIST.getInverseKey());

        return _linkUserApplicationIpAddress;
    }

    private transient LinkUserApplicationUpdateIpAddressPath _linkUserApplicationUpdateIpAddress;

    /**
     * Get the implicit to-many join path to the
     * <code>public.link_user_application_update_ip_address</code> table
     */
    public LinkUserApplicationUpdateIpAddressPath linkUserApplicationUpdateIpAddress() {
        if (_linkUserApplicationUpdateIpAddress == null)
            _linkUserApplicationUpdateIpAddress = new LinkUserApplicationUpdateIpAddressPath(this, null, Keys.LINK_USER_APPLICATION_UPDATE_IP_ADDRESS__FK2_USER_APPLICATION_LIST.getInverseKey());

        return _linkUserApplicationUpdateIpAddress;
    }

    private transient LinkUserApplicationUserApplicationRolePath _linkUserApplicationUserApplicationRole;

    /**
     * Get the implicit to-many join path to the
     * <code>public.link_user_application_user_application_role</code> table
     */
    public LinkUserApplicationUserApplicationRolePath linkUserApplicationUserApplicationRole() {
        if (_linkUserApplicationUserApplicationRole == null)
            _linkUserApplicationUserApplicationRole = new LinkUserApplicationUserApplicationRolePath(this, null, Keys.LINK_USER_APPLICATION_USER_APPLICATION_ROLE__FK_USER_APPLICATION_LIST.getInverseKey());

        return _linkUserApplicationUserApplicationRole;
    }

    private transient LinkUserApplicationUserApplicationUpdateRolePath _linkUserApplicationUserApplicationUpdateRole;

    /**
     * Get the implicit to-many join path to the
     * <code>public.link_user_application_user_application_update_role</code>
     * table
     */
    public LinkUserApplicationUserApplicationUpdateRolePath linkUserApplicationUserApplicationUpdateRole() {
        if (_linkUserApplicationUserApplicationUpdateRole == null)
            _linkUserApplicationUserApplicationUpdateRole = new LinkUserApplicationUserApplicationUpdateRolePath(this, null, Keys.LINK_USER_APPLICATION_USER_APPLICATION_UPDATE_ROLE__FK3_USER_APPLICATION_LIST.getInverseKey());

        return _linkUserApplicationUserApplicationUpdateRole;
    }

    /**
     * Get the implicit many-to-many join path to the
     * <code>public.user_application_role</code> table, via the
     * <code>fk_user_role</code> key
     */
    public UserApplicationRolePath fkUserRole() {
        return linkUserApplicationUserApplicationRole().userApplicationRole();
    }

    /**
     * Get the implicit many-to-many join path to the
     * <code>public.user_application_role</code> table, via the
     * <code>fk1_user_role</code> key
     */
    public UserApplicationRolePath fk1UserRole() {
        return linkUserApplicationUserApplicationUpdateRole().userApplicationRole();
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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