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.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Description :
 * @Reference :
 * @Author : Adair Peng
 * @CreateDate : 2019-03-21 14:13
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="bf_cascade")
@Api(value="级联元素",description = "级联元素")
public class BfCascade extends BaseBean {

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

    @Column(name="CASCADE_NAME")
    @ApiParam(value ="级联名称")
    private String cascadeName;

    @Column(name="CASCADE_GRADE")
    @ApiParam(value ="级联层级")
    private Integer cascadeGrade;

    @Column(name="CASCADE_DESCRIPTION")
    @ApiParam(value ="级联描述")
    private String cascadeDescription;

    @Transient
    @ApiParam(value = "元素详细")
    @AnnoOutputColumn(hidden = true)
    private List<BfCascadeDetail> childList;
}
