package cn.stylefeng.workflow.api.entity.variable;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

@TableName("flow_engine_variable_container")
@Data
@EqualsAndHashCode(callSuper = true)
public class VariableContainer extends BaseEntity {

    @TableId(value = "variable_container_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键id")
    private Long variableContainerId;

    @TableField("model_id")
    @ChineseDescription("流程模型id")
    private Long modelId;

    @TableField("definition_id")
    @ChineseDescription("流程定义id")
    private Long definitionId;

    @TableField("instance_id")
    @ChineseDescription("流程实例id")
    private Long instanceId;

    @TableField("variable_json_value")
    @ChineseDescription("参数的具体的值，存JSON字符串")
    private String variableJsonValue;

    @TableField(value = "version_flag", fill = FieldFill.INSERT)
    @ChineseDescription("乐观锁")
    @Version
    private Long versionFlag;

    @TableField(value = "del_flag", fill = FieldFill.INSERT)
    @TableLogic
    @ChineseDescription("逻辑删除:Y-已删除，N-未删除")
    private String delFlag;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    @ChineseDescription("租户号")
    private Long tenantId;

    @TableField(exist = false)
    @ChineseDescription("json字符串转化后的json对象")
    private JSONObject variableJsonObject;

}
