package com.liangjian.dataplatform.member.entity.po.primary;

import org.hibernate.annotations.GenericGenerator;

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

@Entity(name = "tag_rule_job")
public class TagRuleJob implements Serializable {
    private static final long serialVersionUID =123L;
    @Id
    @GeneratedValue(generator = "metaRelGenerator")
    @GenericGenerator(name = "metaRelGenerator", strategy = "com.liangjian.dataplatform.member.entity.genernator.SnowflakeGenernatorLong")
    private Long id;

    @Column(name = "name")
    private String name;

    @Column(name = "rule_id")
    private Long ruleId;

    @Column(name = "execution_type")
    private Byte executionType;

    @Column(name = "execution_time")
    private Date executionTime;

    @Column(name = "disable")
    private Boolean disable;

    @Column(name = "disrepeat")
    private Boolean disRepeat;

    @Column(name = "repeat_interval")
    private Integer repeatInterval;

    @Column(name = "interval_unit")
    private Byte intervalUnit;

    @Column(name="interval_second")
    private Integer intervalSecond;

    @Column(name = "increment_col")
    private String incrementCol;

    @Column(name = "execution_state")
    private Byte executionState;

    @Column(name = "max_increment")
    private String maxIncrement;

    @Column(name = "last_exectime")
    private Date lastExecTime;

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "rule_id", referencedColumnName = "id",  //关联信息
            insertable = false, updatable = false,
            foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) //不自动建外键
    private TagRuleSecond tagRule;

    public Long getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getRuleId() {
        return ruleId;
    }

    public void setRuleId(Long ruleId) {
        this.ruleId = ruleId;
    }

    public Byte getExecutionType() {
        return executionType;
    }

    public void setExecutionType(Byte executionType) {
        this.executionType = executionType;
    }

    public Date getExecutionTime() {
        return executionTime;
    }

    public void setExecutionTime(Date executionTime) {
        this.executionTime = executionTime;
    }

    public Boolean getDisable() {
        return disable;
    }

    public void setDisable(Boolean disable) {
        this.disable = disable;
    }

    public Boolean getDisRepeat() {
        return disRepeat;
    }

    public void setDisRepeat(Boolean disRepeat) {
        this.disRepeat = disRepeat;
    }

    public Integer getRepeatInterval() {
        return repeatInterval;
    }

    public void setRepeatInterval(Integer repeatInterval) {
        this.repeatInterval = repeatInterval;
    }

    public Byte getIntervalUnit() {
        return intervalUnit;
    }

    public void setIntervalUnit(Byte intervalUnit) {
        this.intervalUnit = intervalUnit;
    }

    public Integer getIntervalSecond() {
        return intervalSecond;
    }

    public void setIntervalSecond(Integer intervalSecond) {
        this.intervalSecond = intervalSecond;
    }

    public String getIncrementCol() {
        return incrementCol;
    }

    public void setIncrementCol(String incrementCol) {
        this.incrementCol = incrementCol;
    }

    public Byte getExecutionState() {
        return executionState;
    }

    public void setExecutionState(Byte executionState) {
        this.executionState = executionState;
    }

    public String getMaxIncrement() {
        return maxIncrement;
    }

    public void setMaxIncrement(String maxIncrement) {
        this.maxIncrement = maxIncrement;
    }

    public Date getLastExecTime() {
        return lastExecTime;
    }

    public void setLastExecTime(Date lastExecTime) {
        this.lastExecTime = lastExecTime;
    }

    public TagRuleSecond getTagRule() {
        return tagRule;
    }

    public void setTagRule(TagRuleSecond tagRule) {
        this.tagRule = tagRule;
    }
}
