/*
 * This file is generated by jOOQ.
 */
package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.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.webbpm.ervu.business_metrics.db_beans.idm_reconcile.IdmReconcile;
import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Keys;
import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.DomainRecord;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>idm_reconcile.domain</code>
     */
    public static final Domain DOMAIN = new Domain();

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

    /**
     * The column <code>idm_reconcile.domain.id</code>.
     */
    public final TableField<DomainRecord, String> ID = createField(DSL.name("id"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column <code>idm_reconcile.domain.version</code>.
     */
    public final TableField<DomainRecord, Integer> VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>idm_reconcile.domain.modified</code>.
     */
    public final TableField<DomainRecord, Timestamp> MODIFIED = createField(DSL.name("modified"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>idm_reconcile.domain.schema</code>.
     */
    public final TableField<DomainRecord, String> SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column <code>idm_reconcile.domain.name</code>.
     */
    public final TableField<DomainRecord, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.shortname</code>.
     */
    public final TableField<DomainRecord, String> SHORTNAME = createField(DSL.name("shortname"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.fullname</code>.
     */
    public final TableField<DomainRecord, String> FULLNAME = createField(DSL.name("fullname"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.dns</code>.
     */
    public final TableField<DomainRecord, String> DNS = createField(DSL.name("dns"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.email</code>.
     */
    public final TableField<DomainRecord, String> EMAIL = createField(DSL.name("email"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.phone</code>.
     */
    public final TableField<DomainRecord, String> PHONE = createField(DSL.name("phone"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.address</code>.
     */
    public final TableField<DomainRecord, String> ADDRESS = createField(DSL.name("address"), SQLDataType.VARCHAR(1024), this, "");

    /**
     * The column <code>idm_reconcile.domain.postal_address</code>.
     */
    public final TableField<DomainRecord, String> POSTAL_ADDRESS = createField(DSL.name("postal_address"), SQLDataType.VARCHAR(1024), this, "");

    /**
     * The column <code>idm_reconcile.domain.address_id</code>.
     */
    public final TableField<DomainRecord, String> ADDRESS_ID = createField(DSL.name("address_id"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.postal_address_id</code>.
     */
    public final TableField<DomainRecord, String> POSTAL_ADDRESS_ID = createField(DSL.name("postal_address_id"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.military_code</code>.
     */
    public final TableField<DomainRecord, String> MILITARY_CODE = createField(DSL.name("military_code"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.timezone</code>.
     */
    public final TableField<DomainRecord, String> TIMEZONE = createField(DSL.name("timezone"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.reports_enabled</code>.
     */
    public final TableField<DomainRecord, Boolean> REPORTS_ENABLED = createField(DSL.name("reports_enabled"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>idm_reconcile.domain.inn</code>.
     */
    public final TableField<DomainRecord, String> INN = createField(DSL.name("inn"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.leg</code>.
     */
    public final TableField<DomainRecord, String> LEG = createField(DSL.name("leg"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.ogrn</code>.
     */
    public final TableField<DomainRecord, String> OGRN = createField(DSL.name("ogrn"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.region</code>.
     */
    public final TableField<DomainRecord, String> REGION = createField(DSL.name("region"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.epgu_id</code>.
     */
    public final TableField<DomainRecord, String> EPGU_ID = createField(DSL.name("epgu_id"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.type</code>.
     */
    public final TableField<DomainRecord, String> TYPE = createField(DSL.name("type"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.esia_employee_authorization</code>.
     */
    public final TableField<DomainRecord, Boolean> ESIA_EMPLOYEE_AUTHORIZATION = createField(DSL.name("esia_employee_authorization"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>idm_reconcile.domain.default_s3_bucket</code>.
     */
    public final TableField<DomainRecord, String> DEFAULT_S3_BUCKET = createField(DSL.name("default_s3_bucket"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.opf</code>.
     */
    public final TableField<DomainRecord, String> OPF = createField(DSL.name("opf"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.kpp</code>.
     */
    public final TableField<DomainRecord, String> KPP = createField(DSL.name("kpp"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.checking_account</code>.
     */
    public final TableField<DomainRecord, String> CHECKING_ACCOUNT = createField(DSL.name("checking_account"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.bik</code>.
     */
    public final TableField<DomainRecord, String> BIK = createField(DSL.name("bik"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.bank_name</code>.
     */
    public final TableField<DomainRecord, String> BANK_NAME = createField(DSL.name("bank_name"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.bank_correspondent_account</code>.
     */
    public final TableField<DomainRecord, String> BANK_CORRESPONDENT_ACCOUNT = createField(DSL.name("bank_correspondent_account"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.oktmo</code>.
     */
    public final TableField<DomainRecord, String> OKTMO = createField(DSL.name("oktmo"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.okato</code>.
     */
    public final TableField<DomainRecord, String> OKATO = createField(DSL.name("okato"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.gov_registration_date</code>.
     */
    public final TableField<DomainRecord, String> GOV_REGISTRATION_DATE = createField(DSL.name("gov_registration_date"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.gov_organization_type</code>.
     */
    public final TableField<DomainRecord, String> GOV_ORGANIZATION_TYPE = createField(DSL.name("gov_organization_type"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.alias_key</code>.
     */
    public final TableField<DomainRecord, String> ALIAS_KEY = createField(DSL.name("alias_key"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.pass_key</code>.
     */
    public final TableField<DomainRecord, String> PASS_KEY = createField(DSL.name("pass_key"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.certificate</code>.
     */
    public final TableField<DomainRecord, String> CERTIFICATE = createField(DSL.name("certificate"), SQLDataType.VARCHAR(2048), this, "");

    /**
     * The column <code>idm_reconcile.domain.account_number_tofk</code>.
     */
    public final TableField<DomainRecord, String> ACCOUNT_NUMBER_TOFK = createField(DSL.name("account_number_tofk"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.bik_tofk</code>.
     */
    public final TableField<DomainRecord, String> BIK_TOFK = createField(DSL.name("bik_tofk"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column
     * <code>idm_reconcile.domain.correspondent_bank_account_tofk</code>.
     */
    public final TableField<DomainRecord, String> CORRESPONDENT_BANK_ACCOUNT_TOFK = createField(DSL.name("correspondent_bank_account_tofk"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.name_tofk</code>.
     */
    public final TableField<DomainRecord, String> NAME_TOFK = createField(DSL.name("name_tofk"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.nsi_organization_id</code>.
     */
    public final TableField<DomainRecord, String> NSI_ORGANIZATION_ID = createField(DSL.name("nsi_organization_id"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.doc_handle</code>.
     */
    public final TableField<DomainRecord, String> DOC_HANDLE = createField(DSL.name("doc_handle"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.division_type</code>.
     */
    public final TableField<DomainRecord, String> DIVISION_TYPE = createField(DSL.name("division_type"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.tns_department_id</code>.
     */
    public final TableField<DomainRecord, String> TNS_DEPARTMENT_ID = createField(DSL.name("tns_department_id"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.enabled</code>.
     */
    public final TableField<DomainRecord, Boolean> ENABLED = createField(DSL.name("enabled"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>idm_reconcile.domain.parent</code>.
     */
    public final TableField<DomainRecord, String> PARENT = createField(DSL.name("parent"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.region_id</code>.
     */
    public final TableField<DomainRecord, String> REGION_ID = createField(DSL.name("region_id"), SQLDataType.VARCHAR(255), this, "");

    /**
     * The column <code>idm_reconcile.domain.managed</code>.
     */
    public final TableField<DomainRecord, String> MANAGED = createField(DSL.name("managed"), SQLDataType.VARCHAR(255), this, "");

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

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

    /**
     * Create an aliased <code>idm_reconcile.domain</code> table reference
     */
    public Domain(String alias) {
        this(DSL.name(alias), DOMAIN);
    }

    /**
     * Create an aliased <code>idm_reconcile.domain</code> table reference
     */
    public Domain(Name alias) {
        this(alias, DOMAIN);
    }

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

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

    @Override
    public UniqueKey<DomainRecord> getPrimaryKey() {
        return Keys.DOMAIN_PKEY;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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