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;

/**
 * @Description :
 * @Reference :
 * @Author : Adair Peng
 * @CreateDate : 2019-03-21 13:24
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BF_ELEMENT_TREE")
@Api(value = "对象元素基础", description = "元素基础表")
public class BfElementTree extends BaseBean {

    private static final long serialVersionUID = -6173269177770192337L;
    //外键关联数据对象主键
    @Column(name = "ELEMENT_ID")
    @ApiParam(value = "对象元素ID", example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long elementId;

    @Column(name = "TREE_PARENT_ID")
    @ApiParam(value = "父级属性ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long treeParentId;

    @Column(name = "TREE_PARENT_RDD")
    @ApiParam(value = "父级属性ID")
    private String treeParentRdd;

    @Column(name = "TREE_ATTR_NAME_ID")
    @ApiParam(value = "显示属性ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long treeAttrNameId;

    @Column(name = "TREE_ATTR_NAME_RDD")
    @ApiParam(value = "显示属性ID")
    private String treeAttrNameRdd;

    @Column(name = "TREE_ATTR_VALUE_ID")
    @ApiParam(value = "取值属性ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long treeAttrValueId;

    @Column(name = "TREE_ATTR_VALUE_RDD")
    @ApiParam(value = "取值属性ID")
    private String treeAttrValueRdd;

    @Column(name="TREE_IS_OPEN_ALL")
    @ApiParam(value ="是否全部展开")
    private Integer treeIsOpenAll;

    @Column(name="TREE_DEFAULT_DIRECTION")
    @ApiParam(value ="树默认方向")
    private Integer treeDefaultDirection;

    @Column(name = "TREE_IS_DIRECTION")
    @ApiParam(value = "树是否开启切换方向")
    private Integer treeIsDirection;

    @Transient
    @ApiParam(value = "父级属性")
    private String treeParentIdStr;

    @Transient
    @ApiParam(value = "显示属性")
    private String treeAttrNameIdStr;

    @Transient
    @ApiParam(value = "取值属性")
    private String treeAttrValueIdStr;
}
