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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of
     * <code>metrics.convert_info_comparison_csv_xml</code>
     */
    public static final ConvertInfoComparisonCsvXml CONVERT_INFO_COMPARISON_CSV_XML = new ConvertInfoComparisonCsvXml();

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

    /**
     * The column
     * <code>metrics.convert_info_comparison_csv_xml.convert_info_comparison_csv_xml_id</code>.
     */
    public final TableField<ConvertInfoComparisonCsvXmlRecord, Long> CONVERT_INFO_COMPARISON_CSV_XML_ID = createField(DSL.name("convert_info_comparison_csv_xml_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

    /**
     * The column
     * <code>metrics.convert_info_comparison_csv_xml.update_date</code>.
     */
    public final TableField<ConvertInfoComparisonCsvXmlRecord, 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_comparison_csv_xml.info_date</code>.
     */
    public final TableField<ConvertInfoComparisonCsvXmlRecord, Date> INFO_DATE = createField(DSL.name("info_date"), SQLDataType.DATE.nullable(false), this, "");

    /**
     * The column
     * <code>metrics.convert_info_comparison_csv_xml.count_xml_formed</code>.
     */
    public final TableField<ConvertInfoComparisonCsvXmlRecord, Long> COUNT_XML_FORMED = createField(DSL.name("count_xml_formed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

    /**
     * The column
     * <code>metrics.convert_info_comparison_csv_xml.count_csv_formed</code>.
     */
    public final TableField<ConvertInfoComparisonCsvXmlRecord, Long> COUNT_CSV_FORMED = createField(DSL.name("count_csv_formed"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

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

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

    /**
     * Create an aliased <code>metrics.convert_info_comparison_csv_xml</code>
     * table reference
     */
    public ConvertInfoComparisonCsvXml(Name alias) {
        this(alias, CONVERT_INFO_COMPARISON_CSV_XML);
    }

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

    public <O extends Record> ConvertInfoComparisonCsvXml(Table<O> path, ForeignKey<O, ConvertInfoComparisonCsvXmlRecord> childPath, InverseForeignKey<O, ConvertInfoComparisonCsvXmlRecord> parentPath) {
        super(path, childPath, parentPath, CONVERT_INFO_COMPARISON_CSV_XML);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<ConvertInfoComparisonCsvXmlRecord> getPrimaryKey() {
        return Keys.CONVERT_INFO_COMPARISON_CSV_XML_PKEY;
    }

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

        return _recruitment;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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