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


import io.github.jklingsporn.vertx.jooq.shared.internal.VertxPojo;

import java.io.Serializable;
import java.time.LocalDateTime;

import static io.github.jklingsporn.vertx.jooq.shared.internal.VertxPojo.setOrThrow;
/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public interface IMRelation extends VertxPojo, Serializable {

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.KEY</code>. 「key」- 关系定义的主键
     */
    public IMRelation setKey(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.KEY</code>. 「key」- 关系定义的主键
     */
    public String getKey();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.TYPE</code>. 「type」- 关系类型 - 来自（字典）
     */
    public IMRelation setType(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.TYPE</code>. 「type」- 关系类型 - 来自（字典）
     */
    public String getType();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.UPSTREAM</code>. 「upstream」- 当前关系是
     * upstream，表示上级
     */
    public IMRelation setUpstream(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.UPSTREAM</code>. 「upstream」- 当前关系是
     * upstream，表示上级
     */
    public String getUpstream();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.DOWNSTREAM</code>. 「downstream」-
     * 当前关系是 downstream，表示下级
     */
    public IMRelation setDownstream(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.DOWNSTREAM</code>. 「downstream」-
     * 当前关系是 downstream，表示下级
     */
    public String getDownstream();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.COMMENTS</code>. 「comments」-
     * 关系定义的描述信息
     */
    public IMRelation setComments(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.COMMENTS</code>. 「comments」-
     * 关系定义的描述信息
     */
    public String getComments();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.SIGMA</code>. 「sigma」- 统一标识
     */
    public IMRelation setSigma(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.SIGMA</code>. 「sigma」- 统一标识
     */
    public String getSigma();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.LANGUAGE</code>. 「language」- 使用的语言
     */
    public IMRelation setLanguage(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.LANGUAGE</code>. 「language」- 使用的语言
     */
    public String getLanguage();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.ACTIVE</code>. 「active」- 是否启用
     */
    public IMRelation setActive(Boolean value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.ACTIVE</code>. 「active」- 是否启用
     */
    public Boolean getActive();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.METADATA</code>. 「metadata」-
     * 附加配置数据
     */
    public IMRelation setMetadata(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.METADATA</code>. 「metadata」-
     * 附加配置数据
     */
    public String getMetadata();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.CREATED_AT</code>. 「createdAt」-
     * 创建时间
     */
    public IMRelation setCreatedAt(LocalDateTime value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.CREATED_AT</code>. 「createdAt」-
     * 创建时间
     */
    public LocalDateTime getCreatedAt();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.CREATED_BY</code>. 「createdBy」-
     * 创建人
     */
    public IMRelation setCreatedBy(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.CREATED_BY</code>. 「createdBy」-
     * 创建人
     */
    public String getCreatedBy();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.UPDATED_AT</code>. 「updatedAt」-
     * 更新时间
     */
    public IMRelation setUpdatedAt(LocalDateTime value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.UPDATED_AT</code>. 「updatedAt」-
     * 更新时间
     */
    public LocalDateTime getUpdatedAt();

    /**
     * Setter for <code>DB_ETERNAL.M_RELATION.UPDATED_BY</code>. 「updatedBy」-
     * 更新人
     */
    public IMRelation setUpdatedBy(String value);

    /**
     * Getter for <code>DB_ETERNAL.M_RELATION.UPDATED_BY</code>. 「updatedBy」-
     * 更新人
     */
    public String getUpdatedBy();

    // -------------------------------------------------------------------------
    // FROM and INTO
    // -------------------------------------------------------------------------

    /**
     * Load data from another generated Record/POJO implementing the common
     * interface IMRelation
     */
    public void from(IMRelation from);

    /**
     * Copy data into another generated Record/POJO implementing the common
     * interface IMRelation
     */
    public <E extends IMRelation> E into(E into);

        @Override
        public default IMRelation fromJson(io.vertx.core.json.JsonObject json) {
                setOrThrow(this::setKey,json::getString,"KEY","java.lang.String");
                setOrThrow(this::setType,json::getString,"TYPE","java.lang.String");
                setOrThrow(this::setUpstream,json::getString,"UPSTREAM","java.lang.String");
                setOrThrow(this::setDownstream,json::getString,"DOWNSTREAM","java.lang.String");
                setOrThrow(this::setComments,json::getString,"COMMENTS","java.lang.String");
                setOrThrow(this::setSigma,json::getString,"SIGMA","java.lang.String");
                setOrThrow(this::setLanguage,json::getString,"LANGUAGE","java.lang.String");
                setOrThrow(this::setActive,json::getBoolean,"ACTIVE","java.lang.Boolean");
                setOrThrow(this::setMetadata,json::getString,"METADATA","java.lang.String");
                setOrThrow(this::setCreatedAt,key -> {String s = json.getString(key); return s==null?null:java.time.LocalDateTime.parse(s);},"CREATED_AT","java.time.LocalDateTime");
                setOrThrow(this::setCreatedBy,json::getString,"CREATED_BY","java.lang.String");
                setOrThrow(this::setUpdatedAt,key -> {String s = json.getString(key); return s==null?null:java.time.LocalDateTime.parse(s);},"UPDATED_AT","java.time.LocalDateTime");
                setOrThrow(this::setUpdatedBy,json::getString,"UPDATED_BY","java.lang.String");
                return this;
        }


        @Override
        public default io.vertx.core.json.JsonObject toJson() {
                io.vertx.core.json.JsonObject json = new io.vertx.core.json.JsonObject();
                json.put("KEY",getKey());
                json.put("TYPE",getType());
                json.put("UPSTREAM",getUpstream());
                json.put("DOWNSTREAM",getDownstream());
                json.put("COMMENTS",getComments());
                json.put("SIGMA",getSigma());
                json.put("LANGUAGE",getLanguage());
                json.put("ACTIVE",getActive());
                json.put("METADATA",getMetadata());
                json.put("CREATED_AT",getCreatedAt()==null?null:getCreatedAt().toString());
                json.put("CREATED_BY",getCreatedBy());
                json.put("UPDATED_AT",getUpdatedAt()==null?null:getUpdatedAt().toString());
                json.put("UPDATED_BY",getUpdatedBy());
                return json;
        }

}
