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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.BlockFormEnumUtil;
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.Lob;
import javax.persistence.Table;

/**
 * @Description : 元素约束
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2020-03-12 13:36
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BF_ELEMENT_CONSTRAINT")
@Api(value = "元素约束", description = "元素约束")
public class BfElementConstraint  extends BaseBean {

    private static final long serialVersionUID = 6951083749548881908L;
    @Column(name = "ELEMENT_ID")
    @ApiParam(value = "对象元素ID", example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long elementId;

    @Column(name = "CONSTRAINT_NAME")
    @ApiParam(value = "约束名称")
    private String constraintName;

    @Column(name = "CONSTRAINT_TYPE")
    @ApiParam(value = "约束类型")
    @AnnoOutputColumn(refClass = BlockFormEnumUtil.ELEMENT_CONSTRAINT_TYPE.class)
    private Integer constraintType;

    @Column(name = "CONSTRAIN_PROPERTY_NAME_RDD")
    @ApiParam(value = "约束属性名称")
    private String constrainPropertyNameRdd;

    @Lob
    @Column(name = "CONSTRAIN_PROPERTY_IDS")
    @ApiParam(value = "约束属性ids")
    private String constrainPropertyIds;

//    @Transient
//    @ApiParam(value = "元素约束属性信息")
//    private List<BfElementConstraintProperty> constraintPropertyList;

}
