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


/**
 * сведения об уголовном преследовании и вынесенном приговоре
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Punishment extends TableImpl<PunishmentRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.punishment</code>
     */
    public static final Punishment PUNISHMENT = new Punishment();

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

    /**
     * The column <code>ervu_dashboard.punishment.punishment_id</code>.
     */
    public final TableField<PunishmentRecord, Long> PUNISHMENT_ID = createField(DSL.name("punishment_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.punishment.sentence</code>. срок или
     * размер наказания
     */
    public final TableField<PunishmentRecord, String> SENTENCE = createField(DSL.name("sentence"), SQLDataType.CLOB, this, "срок или размер наказания");

    /**
     * The column <code>ervu_dashboard.punishment.sentence_changed</code>.
     * изменение срока или размера наказания
     */
    public final TableField<PunishmentRecord, String> SENTENCE_CHANGED = createField(DSL.name("sentence_changed"), SQLDataType.CLOB, this, "изменение срока или размера наказания");

    /**
     * The column <code>ervu_dashboard.punishment.sentense_date</code>. дата
     * вынесения обвинительного приговора
     */
    public final TableField<PunishmentRecord, Date> SENTENSE_DATE = createField(DSL.name("sentense_date"), SQLDataType.DATE, this, "дата вынесения обвинительного приговора");

    /**
     * The column <code>ervu_dashboard.punishment.authority_name</code>.
     * наименование суда, вынесшего приговор
     */
    public final TableField<PunishmentRecord, String> AUTHORITY_NAME = createField(DSL.name("authority_name"), SQLDataType.CLOB, this, "наименование суда, вынесшего приговор");

    /**
     * The column <code>ervu_dashboard.punishment.law_point</code>. пункт,
     * часть, статья УК РФ
     */
    public final TableField<PunishmentRecord, String> LAW_POINT = createField(DSL.name("law_point"), SQLDataType.CLOB, this, "пункт, часть, статья УК РФ");

    /**
     * The column <code>ervu_dashboard.punishment.punishment_type</code>. вид
     * наказания
     */
    public final TableField<PunishmentRecord, String> PUNISHMENT_TYPE = createField(DSL.name("punishment_type"), SQLDataType.CLOB, this, "вид наказания");

    /**
     * The column <code>ervu_dashboard.punishment.punishment_code</code>. код
     * вида наказания
     */
    public final TableField<PunishmentRecord, String> PUNISHMENT_CODE = createField(DSL.name("punishment_code"), SQLDataType.CLOB, this, "код вида наказания");

    /**
     * The column <code>ervu_dashboard.punishment.sentence_place</code>.
     * наименование и адрес места отбывания наказания
     */
    public final TableField<PunishmentRecord, String> SENTENCE_PLACE = createField(DSL.name("sentence_place"), SQLDataType.CLOB, this, "наименование и адрес места отбывания наказания");

    /**
     * The column <code>ervu_dashboard.punishment.start_date</code>. дата начала
     * срока отбывания наказания
     */
    public final TableField<PunishmentRecord, Date> START_DATE = createField(DSL.name("start_date"), SQLDataType.DATE, this, "дата начала срока отбывания наказания");

    /**
     * The column <code>ervu_dashboard.punishment.planned_date</code>. плановая
     * дата отбытия
     */
    public final TableField<PunishmentRecord, Date> PLANNED_DATE = createField(DSL.name("planned_date"), SQLDataType.DATE, this, "плановая дата отбытия");

    /**
     * The column <code>ervu_dashboard.punishment.release_date</code>. дата
     * освобождения
     */
    public final TableField<PunishmentRecord, Date> RELEASE_DATE = createField(DSL.name("release_date"), SQLDataType.DATE, this, "дата освобождения");

    /**
     * The column <code>ervu_dashboard.punishment.release_reason</code>.
     * основание освобождения
     */
    public final TableField<PunishmentRecord, String> RELEASE_REASON = createField(DSL.name("release_reason"), SQLDataType.CLOB, this, "основание освобождения");

    /**
     * The column <code>ervu_dashboard.punishment.mandatory_work</code>. признак
     * отбывания наказания в виде обязательных работ
     */
    public final TableField<PunishmentRecord, Boolean> MANDATORY_WORK = createField(DSL.name("mandatory_work"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "признак отбывания наказания в виде обязательных работ");

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

    private Punishment(Name alias, Table<PunishmentRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения об уголовном преследовании и вынесенном приговоре"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.punishment</code> table reference
     */
    public Punishment(Name alias) {
        this(alias, PUNISHMENT);
    }

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

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

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

    @Override
    public UniqueKey<PunishmentRecord> getPrimaryKey() {
        return Keys.PK_PUNISHMENT;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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