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


/**
 * Сведения о присвоении спортивных разрядов и званий
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CitizenSportsCategories extends TableImpl<CitizenSportsCategoriesRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.citizen_sports_categories</code>
     */
    public static final CitizenSportsCategories CITIZEN_SPORTS_CATEGORIES = new CitizenSportsCategories();

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.citizen_sports_categories_id</code>.
     */
    public final TableField<CitizenSportsCategoriesRecord, Long> CITIZEN_SPORTS_CATEGORIES_ID = createField(DSL.name("citizen_sports_categories_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.sports_category_name</code>.
     * Спортивный разряд
     */
    public final TableField<CitizenSportsCategoriesRecord, String> SPORTS_CATEGORY_NAME = createField(DSL.name("sports_category_name"), SQLDataType.VARCHAR, this, "Спортивный разряд");

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.type_sport</code>. Вид
     * спорта
     */
    public final TableField<CitizenSportsCategoriesRecord, String> TYPE_SPORT = createField(DSL.name("type_sport"), SQLDataType.VARCHAR, this, "Вид спорта");

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.start_date_category</code>.
     * Дата присвоения спортивного разряда
     */
    public final TableField<CitizenSportsCategoriesRecord, Date> START_DATE_CATEGORY = createField(DSL.name("start_date_category"), SQLDataType.DATE, this, "Дата присвоения спортивного разряда");

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.end_date_category</code>.
     * Дата действия спортивного разряда
     */
    public final TableField<CitizenSportsCategoriesRecord, Date> END_DATE_CATEGORY = createField(DSL.name("end_date_category"), SQLDataType.DATE, this, "Дата действия спортивного разряда");

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.sport_title</code>.
     * Спортивное звание
     */
    public final TableField<CitizenSportsCategoriesRecord, String> SPORT_TITLE = createField(DSL.name("sport_title"), SQLDataType.VARCHAR, this, "Спортивное звание");

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.start_date_title</code>.
     * Дата присвоения спортивного звания
     */
    public final TableField<CitizenSportsCategoriesRecord, Date> START_DATE_TITLE = createField(DSL.name("start_date_title"), SQLDataType.DATE, this, "Дата присвоения спортивного звания");

    /**
     * The column
     * <code>ervu_dashboard.citizen_sports_categories.having_sports_category_title</code>.
     * Наличие спортивного разряда или спортивного звания
     */
    public final TableField<CitizenSportsCategoriesRecord, String> HAVING_SPORTS_CATEGORY_TITLE = createField(DSL.name("having_sports_category_title"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("true"), SQLDataType.VARCHAR)), this, "Наличие спортивного разряда или спортивного звания");

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

    private CitizenSportsCategories(Name alias, Table<CitizenSportsCategoriesRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Сведения о присвоении спортивных разрядов и званий"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.citizen_sports_categories</code>
     * table reference
     */
    public CitizenSportsCategories(Name alias) {
        this(alias, CITIZEN_SPORTS_CATEGORIES);
    }

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

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

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

    @Override
    public UniqueKey<CitizenSportsCategoriesRecord> getPrimaryKey() {
        return Keys.PK_CITIZEN_SPORTS_CATEGORIES;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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