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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
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.*;
import java.util.List;

/**
 * @Description :
 * @Reference :
 * @Author : Adair Peng
 * @CreateDate : 2019-03-21 14:02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="bf_element_property_virtual")
@Api(value="对象元素虚拟属性",description = "对象元素虚拟属性")
public class BfElementPropertyVirtual extends BaseBean {

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

    //外键关联数据对象主键
    @Column(name = "DATA_OBJECT_ID")
    @ApiParam(value = "数据对象ID", example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long dataObjectId;

    @Column(name="PROPERTY_CODE")
    @ApiParam(value ="虚拟属性代码")
    private String propertyCode;

    @Column(name="PROPERTY_NAME")
    @ApiParam(value ="显示名称")
    private String propertyName;

    @Lob
    @Column(name="PROPERTY_CODES")
    @ApiParam(value ="属性代码")
    private String propertyCodes;

    @Column(name="PROPERTY_TYPE")
    @ApiParam(value ="属性类型")
    private Integer propertyType;

    @Column(name = "PROPERTY_VIRTUAL_OPERATE_TYPE")
    @ApiParam(value = "虚拟元素类型")
    private Integer propertyVirtualType;

    @Column(name = "PROPERTY_SHOW_FORMAT")
    @ApiParam(value = "显示格式")
    private String propertyShowFormat;

    @Column(name = "PROPERTY_LABEL_TEXT")
    @ApiParam(value = "提示信息")
    private String propertyLabelText;

    @Lob
    @ApiParam(value = "自定义执行SQL")
    @Column(name = "PROPERTY_EXECUTE_SQL")
    private String propertyExecuteSql;

    @Column(name = "PROPERTY_SORT")
    @ApiParam(value = "显示顺序")
    private Integer propertySort;

    @Column(name = "PROPERTY_DESCRIPTION")
    @ApiParam(value = "属性描述")
    private String propertyDescription;

    @Transient
    @ApiParam(value = "虚拟属性列表")
    private List<BfElementProperty> propertyList;

    @Transient
    @ApiParam(value = "虚拟属性列表")
    private List<BfRefElementPropertyVirtualDetail> detailList;

    @Transient
    @ApiParam(value = "虚拟属性ID列表")
    @JsonSerialize(using = ToStringSerializer.class)
    private List<Long> propertyIdList;

}
