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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.prosecution</code>
     */
    public static final Prosecution PROSECUTION = new Prosecution();

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

    /**
     * The column <code>ervu_dashboard.prosecution.prosecution_id</code>.
     */
    public final TableField<ProsecutionRecord, Long> PROSECUTION_ID = createField(DSL.name("prosecution_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.prosecution.kind</code>. вид уголовного
     * преследования
     */
    public final TableField<ProsecutionRecord, String> KIND = createField(DSL.name("kind"), SQLDataType.CLOB, this, "вид уголовного преследования");

    /**
     * The column <code>ervu_dashboard.prosecution.create_date</code>. дата
     * возбуждения уголовного дела
     */
    public final TableField<ProsecutionRecord, Date> CREATE_DATE = createField(DSL.name("create_date"), SQLDataType.DATE, this, "дата возбуждения уголовного дела");

    /**
     * The column <code>ervu_dashboard.prosecution.close_date</code>. дата
     * прекращения уголовного преследования
     */
    public final TableField<ProsecutionRecord, Date> CLOSE_DATE = createField(DSL.name("close_date"), SQLDataType.DATE, this, "дата прекращения уголовного преследования");

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

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

    /**
     * The column <code>ervu_dashboard.prosecution.termination_basis</code>.
     * основание прекращения уголовного преследования
     */
    public final TableField<ProsecutionRecord, String> TERMINATION_BASIS = createField(DSL.name("termination_basis"), SQLDataType.CLOB, this, "основание прекращения уголовного преследования");

    /**
     * The column <code>ervu_dashboard.prosecution.transfer_to_court</code>.
     * признак передачи в суд уголовного дела в отношении гражданина
     */
    public final TableField<ProsecutionRecord, Boolean> TRANSFER_TO_COURT = createField(DSL.name("transfer_to_court"), SQLDataType.BOOLEAN.defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "признак передачи в суд уголовного дела в отношении гражданина");

    /**
     * The column <code>ervu_dashboard.prosecution.case_number</code>. номер
     * уголовного дела (предварительный)
     */
    public final TableField<ProsecutionRecord, String> CASE_NUMBER = createField(DSL.name("case_number"), SQLDataType.CLOB, this, "номер уголовного дела (предварительный)");

    /**
     * The column <code>ervu_dashboard.prosecution.case_number_court</code>.
     * номер уголовного дела (судебный)
     */
    public final TableField<ProsecutionRecord, String> CASE_NUMBER_COURT = createField(DSL.name("case_number_court"), SQLDataType.VARCHAR(50), this, "номер уголовного дела (судебный)");

    /**
     * The column <code>ervu_dashboard.prosecution.reclassification</code>.
     * сведения о переквалификации деяния
     */
    public final TableField<ProsecutionRecord, String> RECLASSIFICATION = createField(DSL.name("reclassification"), SQLDataType.CLOB, this, "сведения о переквалификации деяния");

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

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

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

    /**
     * Create an aliased <code>ervu_dashboard.prosecution</code> table reference
     */
    public Prosecution(Name alias) {
        this(alias, PROSECUTION);
    }

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

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

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

    @Override
    public UniqueKey<ProsecutionRecord> getPrimaryKey() {
        return Keys.PK_PROSECUTION;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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