/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu_dashboard.db_beans.ervu_dashboard.tables;


import java.util.Arrays;
import java.util.Collection;
import java.util.List;

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.EducationFormRecord;


/**
 * Справочник форм обучения
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class EducationForm extends TableImpl<EducationFormRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>ervu_dashboard.education_form</code>
     */
    public static final EducationForm EDUCATION_FORM = new EducationForm();

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

    /**
     * The column <code>ervu_dashboard.education_form.education_form_id</code>.
     */
    public final TableField<EducationFormRecord, Long> EDUCATION_FORM_ID = createField(DSL.name("education_form_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>ervu_dashboard.education_form.code</code>. Cправочный
     * код
     */
    public final TableField<EducationFormRecord, String> CODE = createField(DSL.name("code"), SQLDataType.VARCHAR(15).nullable(false), this, "Cправочный код");

    /**
     * The column <code>ervu_dashboard.education_form.value</code>. Значение
     */
    public final TableField<EducationFormRecord, String> VALUE = createField(DSL.name("value"), SQLDataType.VARCHAR(255).nullable(false), this, "Значение");

    /**
     * The column <code>ervu_dashboard.education_form.description</code>.
     * Описание
     */
    public final TableField<EducationFormRecord, String> DESCRIPTION = createField(DSL.name("description"), SQLDataType.CLOB, this, "Описание");

    /**
     * The column <code>ervu_dashboard.education_form.actual</code>. Признак
     * актуальности справочного значения
     */
    public final TableField<EducationFormRecord, Boolean> ACTUAL = createField(DSL.name("actual"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "Признак актуальности справочного значения");

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

    private EducationForm(Name alias, Table<EducationFormRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Справочник форм обучения"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.education_form</code> table
     * reference
     */
    public EducationForm(Name alias) {
        this(alias, EDUCATION_FORM);
    }

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

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

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

    @Override
    public UniqueKey<EducationFormRecord> getPrimaryKey() {
        return Keys.EDUCATION_FORM_PKEY;
    }

    @Override
    public List<UniqueKey<EducationFormRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.EDUCATION_FORM_CODE_UNIQUE_KEY);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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