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


import ervu_dashboard.ervu_dashboard.db_beans.appeals.Appeals;
import ervu_dashboard.ervu_dashboard.db_beans.appeals.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.appeals.tables.records.MainProfileRecord;
import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;

import java.sql.Date;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.UUID;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.InverseForeignKey;
import org.jooq.Name;
import org.jooq.Path;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.Record;
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;


/**
 * Основной профиль уровень РФ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class MainProfile extends TableImpl<MainProfileRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>appeals.main_profile</code>
     */
    public static final MainProfile MAIN_PROFILE = new MainProfile();

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

    /**
     * The column <code>appeals.main_profile.id_main_profile</code>.
     */
    public final TableField<MainProfileRecord, Long> ID_MAIN_PROFILE = createField(DSL.name("id_main_profile"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>appeals.main_profile.gender</code>. Пол
     */
    public final TableField<MainProfileRecord, String> GENDER = createField(DSL.name("gender"), SQLDataType.CLOB, this, "Пол");

    /**
     * The column <code>appeals.main_profile.age</code>. Возраст
     */
    public final TableField<MainProfileRecord, String> AGE = createField(DSL.name("age"), SQLDataType.CLOB, this, "Возраст");

    /**
     * The column <code>appeals.main_profile.child_min_18</code>. Дети до 18 лет
     */
    public final TableField<MainProfileRecord, String> CHILD_MIN_18 = createField(DSL.name("child_min_18"), SQLDataType.CLOB, this, "Дети до 18 лет");

    /**
     * The column <code>appeals.main_profile.education</code>. Образование
     */
    public final TableField<MainProfileRecord, String> EDUCATION = createField(DSL.name("education"), SQLDataType.CLOB, this, "Образование");

    /**
     * The column <code>appeals.main_profile.employment</code>. Занятость
     */
    public final TableField<MainProfileRecord, String> EMPLOYMENT = createField(DSL.name("employment"), SQLDataType.CLOB, this, "Занятость");

    /**
     * The column <code>appeals.main_profile.recording_date</code>. Дата записи
     */
    public final TableField<MainProfileRecord, Date> RECORDING_DATE = createField(DSL.name("recording_date"), SQLDataType.DATE.defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.DATE)), this, "Дата записи");

    /**
     * The column <code>appeals.main_profile.recruitment_id</code>.
     */
    public final TableField<MainProfileRecord, UUID> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.UUID, this, "");

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

    private MainProfile(Name alias, Table<MainProfileRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Основной профиль уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>appeals.main_profile</code> table reference
     */
    public MainProfile(String alias) {
        this(DSL.name(alias), MAIN_PROFILE);
    }

    /**
     * Create an aliased <code>appeals.main_profile</code> table reference
     */
    public MainProfile(Name alias) {
        this(alias, MAIN_PROFILE);
    }

    /**
     * Create a <code>appeals.main_profile</code> table reference
     */
    public MainProfile() {
        this(DSL.name("main_profile"), null);
    }

    public <O extends Record> MainProfile(Table<O> path, ForeignKey<O, MainProfileRecord> childPath, InverseForeignKey<O, MainProfileRecord> parentPath) {
        super(path, childPath, parentPath, MAIN_PROFILE);
    }

    /**
     * A subtype implementing {@link Path} for simplified path-based joins.
     */
    public static class MainProfilePath extends MainProfile implements Path<MainProfileRecord> {
        public <O extends Record> MainProfilePath(Table<O> path, ForeignKey<O, MainProfileRecord> childPath, InverseForeignKey<O, MainProfileRecord> parentPath) {
            super(path, childPath, parentPath);
        }
        private MainProfilePath(Name alias, Table<MainProfileRecord> aliased) {
            super(alias, aliased);
        }

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

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

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

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

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

    @Override
    public UniqueKey<MainProfileRecord> getPrimaryKey() {
        return Keys.PK_MAIN_PROFILE;
    }

    @Override
    public List<ForeignKey<MainProfileRecord, ?>> getReferences() {
        return Arrays.asList(Keys.MAIN_PROFILE__MAIN_PROFILE_FK1);
    }

    private transient PubRecruitmentPath _pubRecruitment;

    /**
     * Get the implicit join path to the <code>public.pub_recruitment</code>
     * table.
     */
    public PubRecruitmentPath pubRecruitment() {
        if (_pubRecruitment == null)
            _pubRecruitment = new PubRecruitmentPath(this, Keys.MAIN_PROFILE__MAIN_PROFILE_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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