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


/**
 * сведения о лице, опекаемом или находящемся на попечении
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CitizenGuardianship extends TableImpl<CitizenGuardianshipRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>ervu_dashboard.citizen_guardianship</code>
     */
    public static final CitizenGuardianship CITIZEN_GUARDIANSHIP = new CitizenGuardianship();

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

    /**
     * The column
     * <code>ervu_dashboard.citizen_guardianship.citizen_guardianship_id</code>.
     */
    public final TableField<CitizenGuardianshipRecord, Long> CITIZEN_GUARDIANSHIP_ID = createField(DSL.name("citizen_guardianship_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column <code>ervu_dashboard.citizen_guardianship.full_name</code>.
     * ФИО
     */
    public final TableField<CitizenGuardianshipRecord, String> FULL_NAME = createField(DSL.name("full_name"), SQLDataType.VARCHAR, this, "ФИО");

    /**
     * The column <code>ervu_dashboard.citizen_guardianship.birth_date</code>.
     */
    public final TableField<CitizenGuardianshipRecord, Date> BIRTH_DATE = createField(DSL.name("birth_date"), SQLDataType.DATE, this, "");

    /**
     * The column <code>ervu_dashboard.citizen_guardianship.snils</code>.
     */
    public final TableField<CitizenGuardianshipRecord, String> SNILS = createField(DSL.name("snils"), SQLDataType.VARCHAR(50), this, "");

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

    private CitizenGuardianship(Name alias, Table<CitizenGuardianshipRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("сведения о лице, опекаемом или находящемся на попечении"), TableOptions.table(), where);
    }

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

    /**
     * Create an aliased <code>ervu_dashboard.citizen_guardianship</code> table
     * reference
     */
    public CitizenGuardianship(Name alias) {
        this(alias, CITIZEN_GUARDIANSHIP);
    }

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

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

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

    @Override
    public UniqueKey<CitizenGuardianshipRecord> getPrimaryKey() {
        return Keys.PK_CITIZEN_GUARDIANSHIP;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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