/*
 * This file is generated by jOOQ.
 */
package ru.micord.ervu.account_applications.db_beans.public_.tables;


import java.sql.Timestamp;
import java.util.Collection;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
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.ervu.account_applications.db_beans.public_.Keys;
import ru.micord.ervu.account_applications.db_beans.public_.Public;
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.JobPositionRecord;


/**
 * Должность
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class JobPosition extends TableImpl<JobPositionRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.job_position</code>
     */
    public static final JobPosition JOB_POSITION = new JobPosition();

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

    /**
     * The column <code>public.job_position.job_position_id</code>.
     * Идентификатор должности
     */
    public final TableField<JobPositionRecord, Long> JOB_POSITION_ID = createField(DSL.name("job_position_id"), SQLDataType.BIGINT.nullable(false).identity(true), this, "Идентификатор должности");

    /**
     * The column <code>public.job_position.name</code>. Наименование
     */
    public final TableField<JobPositionRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(100).nullable(false), this, "Наименование");

    /**
     * The column <code>public.job_position.code</code>. Код
     */
    public final TableField<JobPositionRecord, String> CODE = createField(DSL.name("code"), SQLDataType.VARCHAR(100).nullable(false), this, "Код");

    /**
     * The column <code>public.job_position.start_date</code>. Дата начала
     */
    public final TableField<JobPositionRecord, Timestamp> START_DATE = createField(DSL.name("start_date"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.TIMESTAMP)), this, "Дата начала");

    /**
     * The column <code>public.job_position.close_date</code>. Дата окончания
     */
    public final TableField<JobPositionRecord, Timestamp> CLOSE_DATE = createField(DSL.name("close_date"), SQLDataType.TIMESTAMP(0), this, "Дата окончания");

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

    private JobPosition(Name alias, Table<JobPositionRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Должность"), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>public.job_position</code> table reference
     */
    public JobPosition(String alias) {
        this(DSL.name(alias), JOB_POSITION);
    }

    /**
     * Create an aliased <code>public.job_position</code> table reference
     */
    public JobPosition(Name alias) {
        this(alias, JOB_POSITION);
    }

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

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

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

    @Override
    public UniqueKey<JobPositionRecord> getPrimaryKey() {
        return Keys.PK_JOB_POSITION;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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