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


/**
 * удостоверение водительское/тракториста-машиниста
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DriversLicence extends TableImpl<DriversLicenceRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.drivers_licence</code>
     */
    public static final DriversLicence DRIVERS_LICENCE = new DriversLicence();

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

    /**
     * The column
     * <code>ervu_dashboard.drivers_licence.drivers_licence_id</code>.
     */
    public final TableField<DriversLicenceRecord, Long> DRIVERS_LICENCE_ID = createField(DSL.name("drivers_licence_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.drivers_licence.tractor_driver</code>.
     * удостоверение тракториста
     */
    public final TableField<DriversLicenceRecord, Boolean> TRACTOR_DRIVER = createField(DSL.name("tractor_driver"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "удостоверение тракториста");

    /**
     * The column <code>ervu_dashboard.drivers_licence.licence_series</code>.
     * серия
     */
    public final TableField<DriversLicenceRecord, String> LICENCE_SERIES = createField(DSL.name("licence_series"), SQLDataType.VARCHAR(50), this, "серия");

    /**
     * The column <code>ervu_dashboard.drivers_licence.licence_number</code>.
     * номер
     */
    public final TableField<DriversLicenceRecord, String> LICENCE_NUMBER = createField(DSL.name("licence_number"), SQLDataType.VARCHAR(50), this, "номер");

    /**
     * The column <code>ervu_dashboard.drivers_licence.start_date</code>. дата
     * выдачи
     */
    public final TableField<DriversLicenceRecord, Date> START_DATE = createField(DSL.name("start_date"), SQLDataType.DATE, this, "дата выдачи");

    /**
     * The column <code>ervu_dashboard.drivers_licence.close_date</code>. дата
     * окончания действия
     */
    public final TableField<DriversLicenceRecord, Date> CLOSE_DATE = createField(DSL.name("close_date"), SQLDataType.DATE, this, "дата окончания действия");

    /**
     * The column <code>ervu_dashboard.drivers_licence.categories</code>.
     * категории
     */
    public final TableField<DriversLicenceRecord, String> CATEGORIES = createField(DSL.name("categories"), SQLDataType.VARCHAR(50), this, "категории");

    /**
     * The column <code>ervu_dashboard.drivers_licence.status</code>. статус
     * удостоверения
     */
    public final TableField<DriversLicenceRecord, String> STATUS = createField(DSL.name("status"), SQLDataType.VARCHAR(50), this, "статус удостоверения");

    /**
     * The column <code>ervu_dashboard.drivers_licence.replacement_date</code>.
     * дата замены
     */
    public final TableField<DriversLicenceRecord, Date> REPLACEMENT_DATE = createField(DSL.name("replacement_date"), SQLDataType.DATE, this, "дата замены");

    /**
     * The column <code>ervu_dashboard.drivers_licence.return_date</code>. дата
     * возврата
     */
    public final TableField<DriversLicenceRecord, Date> RETURN_DATE = createField(DSL.name("return_date"), SQLDataType.DATE, this, "дата возврата");

    /**
     * The column <code>ervu_dashboard.drivers_licence.seizure_date</code>. дата
     * изъятия
     */
    public final TableField<DriversLicenceRecord, Date> SEIZURE_DATE = createField(DSL.name("seizure_date"), SQLDataType.DATE, this, "дата изъятия");

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

    private DriversLicence(Name alias, Table<DriversLicenceRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("удостоверение водительское/тракториста-машиниста"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.drivers_licence</code> table
     * reference
     */
    public DriversLicence(Name alias) {
        this(alias, DRIVERS_LICENCE);
    }

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

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

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

    @Override
    public UniqueKey<DriversLicenceRecord> getPrimaryKey() {
        return Keys.PK_DRIVERS_LICENCE;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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