/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables;


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

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.webbpm.ervu.business_metrics.db_beans.metrics.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.Metrics;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.records.CriminalAdministrativeLiabilityRecord;


/**
 * Учет уголовной, административной ответственности
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CriminalAdministrativeLiability extends TableImpl<CriminalAdministrativeLiabilityRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>metrics.criminal_administrative_liability</code>
     */
    public static final CriminalAdministrativeLiability CRIMINAL_ADMINISTRATIVE_LIABILITY = new CriminalAdministrativeLiability();

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

    /**
     * The column
     * <code>metrics.criminal_administrative_liability.criminal_administrative_liability_id</code>.
     */
    public final TableField<CriminalAdministrativeLiabilityRecord, Long> CRIMINAL_ADMINISTRATIVE_LIABILITY_ID = createField(DSL.name("criminal_administrative_liability_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>metrics.criminal_administrative_liability.recruitment_id</code>.
     */
    public final TableField<CriminalAdministrativeLiabilityRecord, String> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

    /**
     * The column
     * <code>metrics.criminal_administrative_liability.update_date</code>.
     */
    public final TableField<CriminalAdministrativeLiabilityRecord, Timestamp> UPDATE_DATE = createField(DSL.name("update_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");

    /**
     * The column
     * <code>metrics.criminal_administrative_liability.info_date</code>.
     */
    public final TableField<CriminalAdministrativeLiabilityRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column
     * <code>metrics.criminal_administrative_liability.count_administrative</code>.
     */
    public final TableField<CriminalAdministrativeLiabilityRecord, Long> COUNT_ADMINISTRATIVE = createField(DSL.name("count_administrative"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.criminal_administrative_liability.count_criminal</code>.
     */
    public final TableField<CriminalAdministrativeLiabilityRecord, Long> COUNT_CRIMINAL = createField(DSL.name("count_criminal"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.criminal_administrative_liability.count_all</code>.
     */
    public final TableField<CriminalAdministrativeLiabilityRecord, Long> COUNT_ALL = createField(DSL.name("count_all"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private CriminalAdministrativeLiability(Name alias, Table<CriminalAdministrativeLiabilityRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Учет уголовной, административной ответственности"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>metrics.criminal_administrative_liability</code>
     * table reference
     */
    public CriminalAdministrativeLiability(String alias) {
        this(DSL.name(alias), CRIMINAL_ADMINISTRATIVE_LIABILITY);
    }

    /**
     * Create an aliased <code>metrics.criminal_administrative_liability</code>
     * table reference
     */
    public CriminalAdministrativeLiability(Name alias) {
        this(alias, CRIMINAL_ADMINISTRATIVE_LIABILITY);
    }

    /**
     * Create a <code>metrics.criminal_administrative_liability</code> table
     * reference
     */
    public CriminalAdministrativeLiability() {
        this(DSL.name("criminal_administrative_liability"), null);
    }

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

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

    @Override
    public UniqueKey<CriminalAdministrativeLiabilityRecord> getPrimaryKey() {
        return Keys.CRIMINAL_ADMINISTRATIVE_LIABILITY_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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