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


import ervu_dashboard.ervu_dashboard.db_beans.public_.tables.PubRecruitment.PubRecruitmentPath;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.Keys;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.TotalRegistered;
import ervu_dashboard.ervu_dashboard.db_beans.total_registered.tables.records.MaritalStatusRecord;

import java.math.BigDecimal;
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 MaritalStatus extends TableImpl<MaritalStatusRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>total_registered.marital_status</code>
     */
    public static final MaritalStatus MARITAL_STATUS = new MaritalStatus();

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

    /**
     * The column
     * <code>total_registered.marital_status.id_marital_status</code>.
     */
    public final TableField<MaritalStatusRecord, Long> ID_MARITAL_STATUS = createField(DSL.name("id_marital_status"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column <code>total_registered.marital_status.married</code>. В браке
     */
    public final TableField<MaritalStatusRecord, BigDecimal> MARRIED = createField(DSL.name("married"), SQLDataType.NUMERIC, this, "В браке");

    /**
     * The column <code>total_registered.marital_status.not_married</code>.
     * Холост
     */
    public final TableField<MaritalStatusRecord, BigDecimal> NOT_MARRIED = createField(DSL.name("not_married"), SQLDataType.NUMERIC, this, "Холост");

    /**
     * The column <code>total_registered.marital_status.all_M_W</code>.
     * Все/Мужчины/Женщины
     */
    public final TableField<MaritalStatusRecord, String> ALL_M_W = createField(DSL.name("all_M_W"), SQLDataType.CLOB, this, "Все/Мужчины/Женщины");

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

    /**
     * The column <code>total_registered.marital_status.married_percent</code>.
     * В браке в процентах
     */
    public final TableField<MaritalStatusRecord, BigDecimal> MARRIED_PERCENT = createField(DSL.name("married_percent"), SQLDataType.NUMERIC, this, "В браке в процентах");

    /**
     * The column
     * <code>total_registered.marital_status.not_married_percent</code>. Холост
     * в процентах
     */
    public final TableField<MaritalStatusRecord, BigDecimal> NOT_MARRIED_PERCENT = createField(DSL.name("not_married_percent"), SQLDataType.NUMERIC, this, "Холост в процентах");

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

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

    private MaritalStatus(Name alias, Table<MaritalStatusRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Семейное положение состоящих/не состоящих, мужчин/женщин/всех на учете уровень РФ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>total_registered.marital_status</code> table
     * reference
     */
    public MaritalStatus(String alias) {
        this(DSL.name(alias), MARITAL_STATUS);
    }

    /**
     * Create an aliased <code>total_registered.marital_status</code> table
     * reference
     */
    public MaritalStatus(Name alias) {
        this(alias, MARITAL_STATUS);
    }

    /**
     * Create a <code>total_registered.marital_status</code> table reference
     */
    public MaritalStatus() {
        this(DSL.name("marital_status"), null);
    }

    public <O extends Record> MaritalStatus(Table<O> path, ForeignKey<O, MaritalStatusRecord> childPath, InverseForeignKey<O, MaritalStatusRecord> parentPath) {
        super(path, childPath, parentPath, MARITAL_STATUS);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<MaritalStatusRecord> getPrimaryKey() {
        return Keys.PK_MARITAL_STATUS;
    }

    @Override
    public List<ForeignKey<MaritalStatusRecord, ?>> getReferences() {
        return Arrays.asList(Keys.MARITAL_STATUS__MARITAL_STATUS_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.MARITAL_STATUS__MARITAL_STATUS_FK1, null);

        return _pubRecruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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