package cn.estsh.i3plus.pojo.form.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Description :
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2019-03-21 21:03
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BF_METHOD_DETAIL_PROPERTY")
@Api(value="表单功能明细关联属性",description = "表单功能明细关联属性")
public class BfMethodDetailProperty extends BaseBean {

    private static final long serialVersionUID = -7541677357317732343L;
    @Column(name="METHOD_ID")
    @ApiParam(value ="功能id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long methodId;

    // 关联功能明细表id
    @Column(name="PRI_METHOD_DETAIL_ID")
    @ApiParam(value ="主功能明细id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long priMethodDetailId;

    @Column(name="PRI_METHOD_DETAIL_NAME_RDD")
    @ApiParam(value ="主功能明细名称")
    private String priMethodDetailNameRdd;

    @Column(name="PRI_ELEMENT_ID")
    @ApiParam(value ="主对象元素id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long priElementId;

    @Column(name="PRI_ELEMENT_NAME_RDD")
    @ApiParam(value ="主对象元素名称")
    private String priElementNameRdd;

    // 枚举:BlockFormEnumUtil.TRIGGER_EVENT
    @Column(name="PRI_ELEMENT_EVENT")
    @ApiParam(value ="主对象元素事件")
    private Integer priElementEvent;

    @Column(name="SEC_METHOD_DETAIL_ID")
    @ApiParam(value ="关联功能明细id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long secMethodDetailId;

    @Column(name="SEC_METHOD_DETAIL_NAME_RDD")
    @ApiParam(value ="关联功能明细名称")
    private String secMethodDetailNameRdd;

    @Column(name="SEC_ELEMENT_ID")
    @ApiParam(value ="关联对象元素id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long secElementId;

    @Column(name="SEC_ELEMENT_NAME_RDD")
    @ApiParam(value ="关联对象元素名称")
    private String secElementNameRdd;

    @Transient
    @ApiParam(value ="表单功能明细关联属性")
    private List<BfMethodDetailPropertyRef> refList;
}
