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


/**
 * Справочник причин отпуска
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class EducationLeaveReason extends TableImpl<EducationLeaveReasonRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.education_leave_reason</code>
     */
    public static final EducationLeaveReason EDUCATION_LEAVE_REASON = new EducationLeaveReason();

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

    /**
     * The column
     * <code>ervu_dashboard.education_leave_reason.education_leave_reason_id</code>.
     */
    public final TableField<EducationLeaveReasonRecord, Long> EDUCATION_LEAVE_REASON_ID = createField(DSL.name("education_leave_reason_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

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

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

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

    private EducationLeaveReason(Name alias, Table<EducationLeaveReasonRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Справочник причин отпуска"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.education_leave_reason</code>
     * table reference
     */
    public EducationLeaveReason(Name alias) {
        this(alias, EDUCATION_LEAVE_REASON);
    }

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

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

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

    @Override
    public UniqueKey<EducationLeaveReasonRecord> getPrimaryKey() {
        return Keys.EDUCATION_LEAVE_REASON_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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