/*
 * This file is generated by jOOQ.
 */
package cn.vertxup.atom.domain.tables;


import cn.vertxup.atom.domain.Db;
import cn.vertxup.atom.domain.Indexes;
import cn.vertxup.atom.domain.Keys;
import cn.vertxup.atom.domain.tables.records.MAttributeRecord;
import org.jooq.Record;
import org.jooq.*;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;


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

    /**
     * The reference instance of <code>DB_ETERNAL.M_ATTRIBUTE</code>
     */
    public static final MAttribute M_ATTRIBUTE = new MAttribute();
    private static final long serialVersionUID = 1L;
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.KEY</code>. 「key」- 属性ID
     */
    public final TableField<MAttributeRecord, String> KEY = createField(DSL.name("KEY"), SQLDataType.VARCHAR(36).nullable(false), this, "「key」- 属性ID");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.NAME</code>. 「name」- 属性名称
     */
    public final TableField<MAttributeRecord, String> NAME = createField(DSL.name("NAME"), SQLDataType.VARCHAR(255), this, "「name」- 属性名称");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.ALIAS</code>. 「alias」- 属性别名（业务名）
     */
    public final TableField<MAttributeRecord, String> ALIAS = createField(DSL.name("ALIAS"), SQLDataType.VARCHAR(255), this, "「alias」- 属性别名（业务名）");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.TYPE</code>. 「type」-
     * INTERNAL/EXTERNAL/REFERENCE属性
     */
    public final TableField<MAttributeRecord, String> TYPE = createField(DSL.name("TYPE"), SQLDataType.VARCHAR(10), this, "「type」- INTERNAL/EXTERNAL/REFERENCE属性");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.EXPRESSION</code>. 「expression」-
     * 表达式
     */
    public final TableField<MAttributeRecord, String> EXPRESSION = createField(DSL.name("EXPRESSION"), SQLDataType.CLOB, this, "「expression」- 表达式");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.NORMALIZE</code>. 「normalize」-
     * 表达式
     */
    public final TableField<MAttributeRecord, String> NORMALIZE = createField(DSL.name("NORMALIZE"), SQLDataType.CLOB, this, "「normalize」- 表达式");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IN_COMPONENT</code>.
     * 「inComponent」- 写入插件
     */
    public final TableField<MAttributeRecord, String> IN_COMPONENT = createField(DSL.name("IN_COMPONENT"), SQLDataType.VARCHAR(255), this, "「inComponent」- 写入插件");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.OUT_COMPONENT</code>.
     * 「outComponent」- 读取插件
     */
    public final TableField<MAttributeRecord, String> OUT_COMPONENT = createField(DSL.name("OUT_COMPONENT"), SQLDataType.VARCHAR(255), this, "「outComponent」- 读取插件");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.MODEL_ID</code>. 「modelId」-
     * 关联的模型ID
     */
    public final TableField<MAttributeRecord, String> MODEL_ID = createField(DSL.name("MODEL_ID"), SQLDataType.VARCHAR(36), this, "「modelId」- 关联的模型ID");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.COMMENTS</code>. 「comments」-
     * 当前属性的描述信息
     */
    public final TableField<MAttributeRecord, String> COMMENTS = createField(DSL.name("COMMENTS"), SQLDataType.CLOB, this, "「comments」- 当前属性的描述信息");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.SOURCE</code>. 「source」- 关联实体ID
     */
    public final TableField<MAttributeRecord, String> SOURCE = createField(DSL.name("SOURCE"), SQLDataType.VARCHAR(255), this, "「source」- 关联实体ID");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.SOURCE_FIELD</code>.
     * 「sourceField」- 可选，如果不设置则以name为主
     */
    public final TableField<MAttributeRecord, String> SOURCE_FIELD = createField(DSL.name("SOURCE_FIELD"), SQLDataType.VARCHAR(255), this, "「sourceField」- 可选，如果不设置则以name为主");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.SOURCE_CONFIG</code>.
     * 「sourceConfig」- 数据集配置（区分 Array 和 Object）
     */
    public final TableField<MAttributeRecord, String> SOURCE_CONFIG = createField(DSL.name("SOURCE_CONFIG"), SQLDataType.CLOB, this, "「sourceConfig」- 数据集配置（区分 Array 和 Object）");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.SOURCE_REFERENCE</code>.
     * 「sourceReference」- 引用配置信息（ type = REFERENCE）
     */
    public final TableField<MAttributeRecord, String> SOURCE_REFERENCE = createField(DSL.name("SOURCE_REFERENCE"), SQLDataType.CLOB, this, "「sourceReference」- 引用配置信息（ type = REFERENCE）");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.SOURCE_EXTERNAL</code>.
     * 「sourceExternal」- 外部配置信息（ type = EXTERNAL ）
     */
    public final TableField<MAttributeRecord, String> SOURCE_EXTERNAL = createField(DSL.name("SOURCE_EXTERNAL"), SQLDataType.CLOB, this, "「sourceExternal」- 外部配置信息（ type = EXTERNAL ）");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IS_ARRAY</code>. 「isArray」-
     * 是否集合属性，集合属性在导入导出时可用（保留）
     */
    public final TableField<MAttributeRecord, Boolean> IS_ARRAY = createField(DSL.name("IS_ARRAY"), SQLDataType.BIT, this, "「isArray」- 是否集合属性，集合属性在导入导出时可用（保留）");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IS_REFER</code>. 「isRefer」-
     * 是否引用属性的主属性，主属性才可拥有 sourceReference 配置，根据 source 有区别
     */
    public final TableField<MAttributeRecord, Boolean> IS_REFER = createField(DSL.name("IS_REFER"), SQLDataType.BIT, this, "「isRefer」- 是否引用属性的主属性，主属性才可拥有 sourceReference 配置，根据 source 有区别");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IS_SYNC_IN</code>. 「isSyncIn」-
     * 是否同步读
     */
    public final TableField<MAttributeRecord, Boolean> IS_SYNC_IN = createField(DSL.name("IS_SYNC_IN"), SQLDataType.BIT, this, "「isSyncIn」- 是否同步读");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IS_SYNC_OUT</code>. 「isSyncOut」-
     * 是否同步写
     */
    public final TableField<MAttributeRecord, Boolean> IS_SYNC_OUT = createField(DSL.name("IS_SYNC_OUT"), SQLDataType.BIT, this, "「isSyncOut」- 是否同步写");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IS_LOCK</code>. 「isLock」-
     * 是否锁定，锁定属性不可删除
     */
    public final TableField<MAttributeRecord, Boolean> IS_LOCK = createField(DSL.name("IS_LOCK"), SQLDataType.BIT, this, "「isLock」- 是否锁定，锁定属性不可删除");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IS_TRACK</code>. 「isTrack」-
     * 是否实现历史记录，如果是 isTrack 那么启用 ACTIVITY 的变更记录，对应 ITEM
     */
    public final TableField<MAttributeRecord, Boolean> IS_TRACK = createField(DSL.name("IS_TRACK"), SQLDataType.BIT, this, "「isTrack」- 是否实现历史记录，如果是 isTrack 那么启用 ACTIVITY 的变更记录，对应 ITEM");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.IS_CONFIRM</code>. 「isConfirm」-
     * 是否生成待确认变更，只有放在待确认变更中的数据需要生成待确认变更
     */
    public final TableField<MAttributeRecord, Boolean> IS_CONFIRM = createField(DSL.name("IS_CONFIRM"), SQLDataType.BIT, this, "「isConfirm」- 是否生成待确认变更，只有放在待确认变更中的数据需要生成待确认变更");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.SIGMA</code>. 「sigma」- 统一标识
     */
    public final TableField<MAttributeRecord, String> SIGMA = createField(DSL.name("SIGMA"), SQLDataType.VARCHAR(32), this, "「sigma」- 统一标识");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.LANGUAGE</code>. 「language」-
     * 使用的语言
     */
    public final TableField<MAttributeRecord, String> LANGUAGE = createField(DSL.name("LANGUAGE"), SQLDataType.VARCHAR(10), this, "「language」- 使用的语言");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.ACTIVE</code>. 「active」- 是否启用
     */
    public final TableField<MAttributeRecord, Boolean> ACTIVE = createField(DSL.name("ACTIVE"), SQLDataType.BIT, this, "「active」- 是否启用");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.METADATA</code>. 「metadata」-
     * 附加配置数据
     */
    public final TableField<MAttributeRecord, String> METADATA = createField(DSL.name("METADATA"), SQLDataType.CLOB, this, "「metadata」- 附加配置数据");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.CREATED_AT</code>. 「createdAt」-
     * 创建时间
     */
    public final TableField<MAttributeRecord, LocalDateTime> CREATED_AT = createField(DSL.name("CREATED_AT"), SQLDataType.LOCALDATETIME(0), this, "「createdAt」- 创建时间");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.CREATED_BY</code>. 「createdBy」-
     * 创建人
     */
    public final TableField<MAttributeRecord, String> CREATED_BY = createField(DSL.name("CREATED_BY"), SQLDataType.VARCHAR(36), this, "「createdBy」- 创建人");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.UPDATED_AT</code>. 「updatedAt」-
     * 更新时间
     */
    public final TableField<MAttributeRecord, LocalDateTime> UPDATED_AT = createField(DSL.name("UPDATED_AT"), SQLDataType.LOCALDATETIME(0), this, "「updatedAt」- 更新时间");
    /**
     * The column <code>DB_ETERNAL.M_ATTRIBUTE.UPDATED_BY</code>. 「updatedBy」-
     * 更新人
     */
    public final TableField<MAttributeRecord, String> UPDATED_BY = createField(DSL.name("UPDATED_BY"), SQLDataType.VARCHAR(36), this, "「updatedBy」- 更新人");

    private MAttribute(Name alias, Table<MAttributeRecord> aliased) {
        this(alias, aliased, null);
    }

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

    /**
     * Create an aliased <code>DB_ETERNAL.M_ATTRIBUTE</code> table reference
     */
    public MAttribute(String alias) {
        this(DSL.name(alias), M_ATTRIBUTE);
    }

    /**
     * Create an aliased <code>DB_ETERNAL.M_ATTRIBUTE</code> table reference
     */
    public MAttribute(Name alias) {
        this(alias, M_ATTRIBUTE);
    }

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

    public <O extends Record> MAttribute(Table<O> child, ForeignKey<O, MAttributeRecord> key) {
        super(child, key, M_ATTRIBUTE);
    }

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

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

    @Override
    public List<Index> getIndexes() {
        return Arrays.asList(Indexes.M_ATTRIBUTE_IDX_M_ATTRIBUTE_MODEL_ID);
    }

    @Override
    public UniqueKey<MAttributeRecord> getPrimaryKey() {
        return Keys.KEY_M_ATTRIBUTE_PRIMARY;
    }

    @Override
    public List<UniqueKey<MAttributeRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.KEY_M_ATTRIBUTE_NAME);
    }

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

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

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

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

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

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