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

import com.liangjian.dataplatform.member.entity.po.BasicEntity;

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

/**
 * @Author: 黄子奇
 * @Date: 2019/9/9 10:14
 *
 * 用于存储标签规则的表
 */
@Entity(name = "tag_rule")
public class TagRule extends BasicEntity implements Serializable {
    private static final long serialVersionUID = 7765100397803094109L;

    private String name;

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

    private Integer object; //面向对象

    @Column(name = "object_range")
    private String objectRange; //对象范围

    @Column(name = "output_type")
    private Integer outputType; //产出类型

    @Column(name = "output_entity", columnDefinition="TEXT")
    private String outputEntity; //条件产出的json / 直接产出的字段信息的json

    @Column(name = "relative_table", columnDefinition = "TEXT")
    private String relativeTable;

    @Column(name = "job_id")
    private String jobId; //运行作业的id

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

    public String getName() {
        return name;
    }

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

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Integer getObject() {
        return object;
    }

    public void setObject(Integer object) {
        this.object = object;
    }

    public String getObjectRange() {
        return objectRange;
    }

    public void setObjectRange(String objectRange) {
        this.objectRange = objectRange;
    }

    public Integer getOutputType() {
        return outputType;
    }

    public void setOutputType(Integer outputType) {
        this.outputType = outputType;
    }

    public String getOutputEntity() {
        return outputEntity;
    }

    public void setOutputEntity(String outputEntity) {
        this.outputEntity = outputEntity;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public JobInfo getJobInfo() {
        return jobInfo;
    }

    public void setJobInfo(JobInfo jobInfo) {
        this.jobInfo = jobInfo;
    }

    public String getRelativeTable() {
        return relativeTable;
    }

    public void setRelativeTable(String relativeTable) {
        this.relativeTable = relativeTable;
    }
}
