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


import java.util.Collection;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
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.records.UserApplicationDocumentRecord;


/**
 * Документы в заявке пользователя
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class UserApplicationDocument extends TableImpl<UserApplicationDocumentRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.user_application_document</code>
     */
    public static final UserApplicationDocument USER_APPLICATION_DOCUMENT = new UserApplicationDocument();

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

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

    /**
     * The column <code>public.user_application_document.file_name</code>.
     * Документ-обоснование
     */
    public final TableField<UserApplicationDocumentRecord, String> FILE_NAME = createField(DSL.name("file_name"), SQLDataType.VARCHAR(100), this, "Документ-обоснование");

    /**
     * The column <code>public.user_application_document.file</code>. Файл
     */
    public final TableField<UserApplicationDocumentRecord, byte[]> FILE = createField(DSL.name("file"), SQLDataType.BLOB, this, "Файл");

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

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

    private UserApplicationDocument(Name alias, Table<UserApplicationDocumentRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Документы в заявке пользователя"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>public.user_application_document</code> table
     * reference
     */
    public UserApplicationDocument(String alias) {
        this(DSL.name(alias), USER_APPLICATION_DOCUMENT);
    }

    /**
     * Create an aliased <code>public.user_application_document</code> table
     * reference
     */
    public UserApplicationDocument(Name alias) {
        this(alias, USER_APPLICATION_DOCUMENT);
    }

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

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

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

    @Override
    public UniqueKey<UserApplicationDocumentRecord> getPrimaryKey() {
        return Keys.PK_USER_APPLICATION_DOCUMENT;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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