package com.casic.PgInterface.reservePlan.domain;

import com.casic.PgInterface.devTable.domain.PgAlarmType;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by yxw on 2017/11/1.
 */
@Entity
@Table(name = "PG_RESERVE_PLAN")
@SequenceGenerator(name = "SEQ_PG_RESERVE_PLAN_ID", sequenceName = "SEQ_PG_RESERVE_PLAN_ID",allocationSize=1,initialValue=1)
public class PgReservePlan implements Serializable {
    private static final long serialVersionUID = 1L;
    private long id;
    private String planName;//预案名称
    private String planType;//预案类型
    private String resUnit;//责任单位
    private String planFile;//预案文档
    private int active;//状态位
    private PgAlarmType pgAlarmTypeId;//报警类型

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_RESERVE_PLAN_ID")
    public long getId() {
        return id;
    }

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

    @Column(name = "PLAN_NAME")
    public String getPlanName() {
        return planName;
    }

    public void setPlanName(String planName) {
        this.planName = planName;
    }

    @Column(name = "PLAN_TYPE")
    public String getPlanType() {
        return planType;
    }

    public void setPlanType(String planType) {
        this.planType = planType;
    }

    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "ALARMTYPEID")
    public PgAlarmType getPgAlarmTypeId() {
        return pgAlarmTypeId;
    }

    public void setPgAlarmTypeId(PgAlarmType pgAlarmTypeId) {
        this.pgAlarmTypeId = pgAlarmTypeId;
    }

    @Column(name = "RESUNIT")
    public String getResUnit() {
        return resUnit;
    }

    public void setResUnit(String resUnit) {
        this.resUnit = resUnit;
    }

    @Column(name = "PLAN_FIEL")
    public String getPlanFile() {
        return planFile;
    }

    public void setPlanFile(String planFile) {
        this.planFile = planFile;
    }

    @Column(name = "ACTIVE")
    public int getActive() {
        return active;
    }

    public void setActive(int active) {
        this.active = active;
    }


}
