/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.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.tables.Recruitment.RecruitmentPath;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.SummonsesList;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.tables.SummonsesReason.SummonsesReasonPath;
import ru.micord.webbpm.ervu.business_metrics.db_beans.summonses_list.tables.records.DownloadForPrintRecord;


/**
 * Реестр повесток. Отправка уведомлений в ЛК на ЕПГУ
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DownloadForPrint extends TableImpl<DownloadForPrintRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>summonses_list.download_for_print</code>
     */
    public static final DownloadForPrint DOWNLOAD_FOR_PRINT = new DownloadForPrint();

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

    /**
     * The column
     * <code>summonses_list.download_for_print.download_for_print_id</code>.
     */
    public final TableField<DownloadForPrintRecord, Long> DOWNLOAD_FOR_PRINT_ID = createField(DSL.name("download_for_print_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "");

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

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

    /**
     * The column
     * <code>summonses_list.download_for_print.summonses_reason_id</code>.
     */
    public final TableField<DownloadForPrintRecord, Long> SUMMONSES_REASON_ID = createField(DSL.name("summonses_reason_id"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column
     * <code>summonses_list.download_for_print.count_donloaded</code>.
     */
    public final TableField<DownloadForPrintRecord, Long> COUNT_DONLOADED = createField(DSL.name("count_donloaded"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");

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

    private DownloadForPrint(Name alias, Table<DownloadForPrintRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Реестр повесток. Отправка уведомлений в ЛК на ЕПГУ"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>summonses_list.download_for_print</code> table
     * reference
     */
    public DownloadForPrint(String alias) {
        this(DSL.name(alias), DOWNLOAD_FOR_PRINT);
    }

    /**
     * Create an aliased <code>summonses_list.download_for_print</code> table
     * reference
     */
    public DownloadForPrint(Name alias) {
        this(alias, DOWNLOAD_FOR_PRINT);
    }

    /**
     * Create a <code>summonses_list.download_for_print</code> table reference
     */
    public DownloadForPrint() {
        this(DSL.name("download_for_print"), null);
    }

    public <O extends Record> DownloadForPrint(Table<O> path, ForeignKey<O, DownloadForPrintRecord> childPath, InverseForeignKey<O, DownloadForPrintRecord> parentPath) {
        super(path, childPath, parentPath, DOWNLOAD_FOR_PRINT);
    }

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

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

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

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

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

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

    @Override
    public UniqueKey<DownloadForPrintRecord> getPrimaryKey() {
        return Keys.DOWNLOAD_FOR_PRINT_PKEY;
    }

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

        return _recruitment;
    }

    private transient SummonsesReasonPath _summonsesReason;

    /**
     * Get the implicit join path to the
     * <code>summonses_list.summonses_reason</code> table.
     */
    public SummonsesReasonPath summonsesReason() {
        if (_summonsesReason == null)
            _summonsesReason = new SummonsesReasonPath(this, Keys.DOWNLOAD_FOR_PRINT__FK_SUMMONSES_REASON_ID, null);

        return _summonsesReason;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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