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


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Shedlock extends TableImpl<ShedlockRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>public.shedlock</code>
     */
    public static final Shedlock SHEDLOCK = new Shedlock();

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

    /**
     * The column <code>public.shedlock.name</code>.
     */
    public final TableField<ShedlockRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column <code>public.shedlock.lock_until</code>.
     */
    public final TableField<ShedlockRecord, Timestamp> LOCK_UNTIL = createField(DSL.name("lock_until"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>public.shedlock.locked_at</code>.
     */
    public final TableField<ShedlockRecord, Timestamp> LOCKED_AT = createField(DSL.name("locked_at"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>public.shedlock.locked_by</code>.
     */
    public final TableField<ShedlockRecord, String> LOCKED_BY = createField(DSL.name("locked_by"), SQLDataType.VARCHAR(255), this, "");

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

    private Shedlock(Name alias, Table<ShedlockRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>public.shedlock</code> table reference
     */
    public Shedlock(String alias) {
        this(DSL.name(alias), SHEDLOCK);
    }

    /**
     * Create an aliased <code>public.shedlock</code> table reference
     */
    public Shedlock(Name alias) {
        this(alias, SHEDLOCK);
    }

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

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

    @Override
    public UniqueKey<ShedlockRecord> getPrimaryKey() {
        return Keys.SHEDLOCK_PK;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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