/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables;


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

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;

import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.Metrics;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.Recruitment.RecruitmentPath;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.tables.records.ConvertInfoCommonResultsRecord;


/**
 * Конвертация. Результаты
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ConvertInfoCommonResults extends TableImpl<ConvertInfoCommonResultsRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>metrics.convert_info_common_results</code>
     */
    public static final ConvertInfoCommonResults CONVERT_INFO_COMMON_RESULTS = new ConvertInfoCommonResults();

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

    /**
     * The column
     * <code>metrics.convert_info_common_results.convert_info_common_results_id</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, Long> CONVERT_INFO_COMMON_RESULTS_ID = createField(DSL.name("convert_info_common_results_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

    /**
     * The column
     * <code>metrics.convert_info_common_results.recruitment_id</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, String> RECRUITMENT_ID = createField(DSL.name("recruitment_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");

    /**
     * The column <code>metrics.convert_info_common_results.update_date</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, Timestamp> UPDATE_DATE = createField(DSL.name("update_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "");

    /**
     * The column <code>metrics.convert_info_common_results.info_date</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column
     * <code>metrics.convert_info_common_results.count_confirmed</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, Long> COUNT_CONFIRMED = createField(DSL.name("count_confirmed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column <code>metrics.convert_info_common_results.count_signed</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, Long> COUNT_SIGNED = createField(DSL.name("count_signed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.convert_info_common_results.count_manual_convert</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, Long> COUNT_MANUAL_CONVERT = createField(DSL.name("count_manual_convert"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.convert_info_common_results.count_canceled</code>.
     */
    public final TableField<ConvertInfoCommonResultsRecord, Long> COUNT_CANCELED = createField(DSL.name("count_canceled"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private ConvertInfoCommonResults(Name alias, Table<ConvertInfoCommonResultsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Конвертация. Результаты"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>metrics.convert_info_common_results</code> table
     * reference
     */
    public ConvertInfoCommonResults(String alias) {
        this(DSL.name(alias), CONVERT_INFO_COMMON_RESULTS);
    }

    /**
     * Create an aliased <code>metrics.convert_info_common_results</code> table
     * reference
     */
    public ConvertInfoCommonResults(Name alias) {
        this(alias, CONVERT_INFO_COMMON_RESULTS);
    }

    /**
     * Create a <code>metrics.convert_info_common_results</code> table reference
     */
    public ConvertInfoCommonResults() {
        this(DSL.name("convert_info_common_results"), null);
    }

    public <O extends Record> ConvertInfoCommonResults(Table<O> path, ForeignKey<O, ConvertInfoCommonResultsRecord> childPath, InverseForeignKey<O, ConvertInfoCommonResultsRecord> parentPath) {
        super(path, childPath, parentPath, CONVERT_INFO_COMMON_RESULTS);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<ConvertInfoCommonResultsRecord> getPrimaryKey() {
        return Keys.CONVERT_INFO_COMMON_RESULTS_PKEY;
    }

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

    private transient RecruitmentPath _recruitment;

    /**
     * Get the implicit join path to the <code>metrics.recruitment</code> table.
     */
    public RecruitmentPath recruitment() {
        if (_recruitment == null)
            _recruitment = new RecruitmentPath(this, Keys.CONVERT_INFO_COMMON_RESULTS__FK_CONV_INFO_RECORDS_FROM_EASU_RECRUITMENT_ID, null);

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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