package com.casic.PgInterface.construction.domain;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

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

/**
 * Created by zxh on 2018/3/28.
 */

@Entity
@Table(name = "PG_CSDOCUMENT")
@SequenceGenerator(name = "SEQ_PG_CSDOCUMENT_ID", sequenceName = "SEQ_PG_CSDOCUMENT_ID", allocationSize = 1, initialValue = 1)
public class PgCsDocument implements Serializable {

    private static final long serialVersionUID = 1L;
    private long id;
    private String list_name;//表单名称
    private String doc_name;//文档名称
    private String construct_doc;//施工文档相对路径
    private PgConstruction pgConstructionId;//项目
    private int active;//状态位

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

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

    @Column(name = "LIST_NAME")
    public String getList_name() {
        return list_name;
    }

    public void setList_name(String list_name) {
        this.list_name = list_name;
    }

    @Column(name = "DOC_NAME")
    public String getDoc_name() {
        return doc_name;
    }

    public void setDoc_name(String doc_name) {
        this.doc_name = doc_name;
    }

    @Column(name = "CONSTRUCT_DOC")
    public String getConstruct_doc() {
        return construct_doc;
    }

    public void setConstruct_doc(String construct_doc) {
        this.construct_doc = construct_doc;
    }

    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "PGCONSTRUCTION_ID")
    public PgConstruction getPgConstructionId() {
        return pgConstructionId;
    }

    public void setPgConstructionId(PgConstruction pgConstructionId) {
        this.pgConstructionId = pgConstructionId;
    }

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

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

}
