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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.BlockSoftSwitchEnumUtil;
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-04-15 16:56
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_LONG_DATA")
@Api(value = "长数据", description = "长数据")
public class BsLongData extends BaseBean {

    private static final long serialVersionUID = -329128754646765129L;
    @Column(name = "REF_ID")
    @ApiParam(value = "关联id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long refId;

    @Column(name = "REF_DATA_TYPE")
    @ApiParam(value = "数据类型")
    @AnnoOutputColumn(refClass = BlockSoftSwitchEnumUtil.REF_DATA_TYPE.class)
    private Integer refDataType;

    @Lob
    @Column(name = "DATA")
    @ApiParam(value = "数据")
    private String data;
}
