package cn.com.qmth.stmms.ms.core.domain;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @Description: 定时任务调度 entity
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/1/19
 */
@Entity
@Table(name = "mark_task_job")
@DynamicInsert
@DynamicUpdate
public class MarkTaskJob implements Serializable {

    private static final long serialVersionUID = -8376036816154911286L;

    private Long id;
    @NotNull
    private String dataObject;//object

    @NotNull
    private Date createTime;//创建时间

    private Boolean status;//状态，0：未记录，1：已记录

    private Long workId;//workId

    private Integer version = 0;

    public MarkTaskJob() {

    }

    public MarkTaskJob(String dataObject, Boolean status, Long workId) {
        this.dataObject = dataObject;
        this.createTime = new Date();
        this.status = status;
        this.workId = workId;
    }

    @Id
    @GeneratedValue
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @Basic
    @Column(name = "data_object")
    public String getDataObject() {
        return dataObject;
    }

    public void setDataObject(String dataObject) {
        this.dataObject = dataObject;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "status")
    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    @Basic
    @Column(name = "work_id")
    public Long getWorkId() {
        return workId;
    }

    public void setWorkId(Long workId) {
        this.workId = workId;
    }

    @Basic
    @Column(name = "version")
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
