EventDataEntity.java 4.85 KB
package com.viontech.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.viontech.common.VionTechJsonbType;
import com.viontech.entity.archive.EventArchiveRelEntity;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator
 */
@Entity
@Table(name = "tb_event_data")
@Inheritance(strategy = InheritanceType.JOINED)
@TypeDef(name = "json", typeClass = VionTechJsonbType.class)
public class EventDataEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    Integer event_unid;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "event_dt", nullable = true)
    Date eventDt;
    @Column(name = "task_type",  nullable = true)
    private String taskType;
    @Column(name = "task_id",  nullable = true)
    private String taskId;
    @Column(name = "event_type", nullable = true)
    private String eventType;
    @Column(name = "event_refid",  nullable = true)
    private String eventRefid;
    @Column(name = "pics",  nullable = true, columnDefinition = "jsonb")
    @Type(type = "json")
    private List pics;
    @Column(name = "event_cate",  nullable = true)
    private String eventCate;
    @Column(name = "video",  nullable = true, columnDefinition = "jsonb")
    @Type(type = "json")
    private List video;
    @Column(name = "subtask_id",  nullable = true)
    private String subtaskId;
    @Column(name = "source_type",  nullable = true)
    private String sourceType;
    @Column(name = "location_name",  nullable = true)
    private String locationName;
    @Column(name = "location_code",  nullable = true)
    private String locationCode;

    @Column(name = "original_json",  nullable = true, columnDefinition = "jsonb")
    @Type(type = "json")
    private Object originalJson;

    @OneToMany(cascade={CascadeType.ALL,CascadeType.REMOVE})
    @JoinColumn(name="event_unid")
    private List<EventArchiveRelEntity> eventArchiveRelEntitys;


    @Column(name="is_archive")
    private Boolean isArchive=false;


    public Integer getEvent_unid() {
        return event_unid;
    }

    public void setEvent_unid(Integer event_unid) {
        this.event_unid = event_unid;
    }

    public Date getEventDt() {
        return eventDt;
    }

    public void setEventDt(Date eventDt) {
        this.eventDt = eventDt;
    }

    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public String getEventRefid() {
        return eventRefid;
    }

    public void setEventRefid(String eventRefid) {
        this.eventRefid = eventRefid;
    }

    public String getEventCate() {
        return eventCate;
    }

    public void setEventCate(String eventCate) {
        this.eventCate = eventCate;
    }

    public String getSubtaskId() {
        return subtaskId;
    }

    public void setSubtaskId(String subtaskId) {
        this.subtaskId = subtaskId;
    }

    public String getSourceType() {
        return sourceType;
    }

    public void setSourceType(String sourceType) {
        this.sourceType = sourceType;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getLocationCode() {
        return locationCode;
    }

    public void setLocationCode(String locationCode) {
        this.locationCode = locationCode;
    }

    public Object getOriginalJson() {
        return originalJson;
    }

    public void setOriginalJson(Object originalJson) {
        this.originalJson = originalJson;
    }

    public List<EventArchiveRelEntity> getEventArchiveRelEntitys() {
        return eventArchiveRelEntitys;
    }

    public void setEventArchiveRelEntitys(List<EventArchiveRelEntity> eventArchiveRelEntitys) {
        this.eventArchiveRelEntitys = eventArchiveRelEntitys;
    }

    public List getPics() {
        return pics;
    }

    public void setPics(List pics) {
        this.pics = pics;
    }

    public List getVideo() {
        return video;
    }

    public void setVideo(List video) {
        this.video = video;
    }

    public Boolean getArchive() {
        return isArchive;
    }

    public void setArchive(Boolean archive) {
        isArchive = archive;
    }
}