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


/**
 * Сведения о судимости
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CitizenCriminalRecord extends TableImpl<CitizenCriminalRecordRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.citizen_criminal_record</code>
     */
    public static final CitizenCriminalRecord CITIZEN_CRIMINAL_RECORD = new CitizenCriminalRecord();

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_criminal_record.citizen_criminal_record_id</code>.
     */
    public final TableField<CitizenCriminalRecordRecord, Long> CITIZEN_CRIMINAL_RECORD_ID = createField(DSL.name("citizen_criminal_record_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_criminal_record.criminal_record_name</code>.
     * Наименование судимости
     */
    public final TableField<CitizenCriminalRecordRecord, String> CRIMINAL_RECORD_NAME = createField(DSL.name("criminal_record_name"), SQLDataType.VARCHAR, this, "Наименование судимости");

    /**
     * The column
     * <code>ervu_dashboard.citizen_criminal_record.end_date_criminal_record</code>.
     * Дата погашения или снятия судимости
     */
    public final TableField<CitizenCriminalRecordRecord, Date> END_DATE_CRIMINAL_RECORD = createField(DSL.name("end_date_criminal_record"), SQLDataType.DATE, this, "Дата погашения или снятия судимости");

    /**
     * The column
     * <code>ervu_dashboard.citizen_criminal_record.grounds_expunging</code>.
     * Основание погашения или снятия судимости
     */
    public final TableField<CitizenCriminalRecordRecord, String> GROUNDS_EXPUNGING = createField(DSL.name("grounds_expunging"), SQLDataType.VARCHAR, this, "Основание погашения или снятия судимости");

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

    private CitizenCriminalRecord(Name alias, Table<CitizenCriminalRecordRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Сведения о судимости"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.citizen_criminal_record</code>
     * table reference
     */
    public CitizenCriminalRecord(Name alias) {
        this(alias, CITIZEN_CRIMINAL_RECORD);
    }

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

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

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

    @Override
    public UniqueKey<CitizenCriminalRecordRecord> getPrimaryKey() {
        return Keys.PK_CITIZEN_CRIMINAL_RECORD;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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