/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables;


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

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_dashboard.db_beans.ervu_dashboard.ErvuDashboard;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.Keys;
import ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables.records.PassportRecord;


/**
 * сведения о паспорте
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Passport extends TableImpl<PassportRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.passport</code>
     */
    public static final Passport PASSPORT = new Passport();

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

    /**
     * The column <code>ervu_dashboard.passport.passport_id</code>.
     */
    public final TableField<PassportRecord, Long> PASSPORT_ID = createField(DSL.name("passport_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ervu_dashboard.passport.recruit_id</code>. ссылка на
     * гражданина (citizen)
     */
    public final TableField<PassportRecord, UUID> RECRUIT_ID = createField(DSL.name("recruit_id"), SQLDataType.UUID.nullable(false), this, "ссылка на гражданина (citizen)");

    /**
     * The column <code>ervu_dashboard.passport.actual</code>. статус документа:
     * действительный(true)/недействительный(false)
     */
    public final TableField<PassportRecord, Boolean> ACTUAL = createField(DSL.name("actual"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "статус документа: действительный(true)/недействительный(false)");

    /**
     * The column <code>ervu_dashboard.passport.passport_series</code>. серия
     * паспорта
     */
    public final TableField<PassportRecord, String> PASSPORT_SERIES = createField(DSL.name("passport_series"), SQLDataType.VARCHAR(4), this, "серия паспорта");

    /**
     * The column <code>ervu_dashboard.passport.passport_number</code>. номер
     * паспорта
     */
    public final TableField<PassportRecord, String> PASSPORT_NUMBER = createField(DSL.name("passport_number"), SQLDataType.VARCHAR(6), this, "номер паспорта");

    /**
     * The column <code>ervu_dashboard.passport.issue_date</code>. дата выдачи
     * документа
     */
    public final TableField<PassportRecord, Date> ISSUE_DATE = createField(DSL.name("issue_date"), SQLDataType.DATE, this, "дата выдачи документа");

    /**
     * The column <code>ervu_dashboard.passport.organization_name</code>.
     * наименование органа, выдавшего документ
     */
    public final TableField<PassportRecord, String> ORGANIZATION_NAME = createField(DSL.name("organization_name"), SQLDataType.VARCHAR(255), this, "наименование органа, выдавшего документ");

    /**
     * The column <code>ervu_dashboard.passport.unit_code</code>. код
     * подразделения
     */
    public final TableField<PassportRecord, String> UNIT_CODE = createField(DSL.name("unit_code"), SQLDataType.VARCHAR(7), this, "код подразделения");

    /**
     * The column <code>ervu_dashboard.passport.type_dul</code>. Вид ДУЛ
     */
    public final TableField<PassportRecord, String> TYPE_DUL = createField(DSL.name("type_dul"), SQLDataType.VARCHAR, this, "Вид ДУЛ");

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

    private Passport(Name alias, Table<PassportRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения о паспорте"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>ervu_dashboard.passport</code> table reference
     */
    public Passport(String alias) {
        this(DSL.name(alias), PASSPORT);
    }

    /**
     * Create an aliased <code>ervu_dashboard.passport</code> table reference
     */
    public Passport(Name alias) {
        this(alias, PASSPORT);
    }

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

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

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

    @Override
    public UniqueKey<PassportRecord> getPrimaryKey() {
        return Keys.PK_PASSPORT;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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