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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.viontech.common.VionTechJsonbType;
import com.viontech.entity.archive.EventArchiveRelEntity;
import lombok.ToString;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

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

/**
 * Created by Administrator
 */
@Entity
@Table(name = "tb_event_data")
@Inheritance(strategy = InheritanceType.JOINED)
@TypeDef(name = "json", typeClass = VionTechJsonbType.class)
@ToString
public class EventDataEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    Integer event_unid;
    //@JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="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 Object pics;
    @Column(name = "event_cate",  nullable = true)
    private String eventCate;
    @Column(name = "video",  nullable = true, columnDefinition = "jsonb")
    @Type(type = "json")
    private Object 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;

    @OneToOne(mappedBy = "eventDataEntity",cascade={CascadeType.ALL,CascadeType.REMOVE})
    private EventArchiveRelEntity eventArchiveRelEntity;


    @OneToOne(mappedBy = "eventDataEntity",cascade={CascadeType.ALL,CascadeType.REMOVE})
    private TrafficEntity trafficEntity;

    @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 EventArchiveRelEntity getEventArchiveRelEntity() {
        return eventArchiveRelEntity;
    }

    public void setEventArchiveRelEntity(EventArchiveRelEntity eventArchiveRelEntity) {
        this.eventArchiveRelEntity = eventArchiveRelEntity;
    }

    public Object getPics() {
        return pics;
    }

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

    public Object getVideo() {
        return video;
    }

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

    public Boolean getArchive() {
        return isArchive;
    }

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

    public TrafficEntity getTrafficEntity() {
        return trafficEntity;
    }

    public void setTrafficEntity(TrafficEntity trafficEntity) {
        this.trafficEntity = trafficEntity;
    }
}