package com.casic.PgInterface.overtimeInPG.domain;

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

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


@Entity
@Table(name = "PG_INPG_STATUS")
@SequenceGenerator(name = "SEQ_PG_INPG_STATUS_ID", sequenceName = "SEQ_PG_INPG_STATUS_ID",allocationSize=1,initialValue=1)
public class PgInPgStatus implements Serializable {

    private static final long serialVersionUID = 1L;
    private long id;
    private Date inTime;//入廊时间
    private Date outTime;//出廊时间
    private PgInPgPerson pgInPgPersonId;//入廊人员

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

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

    @Column(name = "INTIME")
    public Date getInTime() {
        return inTime;
    }

    public void setInTime(Date inTime) {
        this.inTime = inTime;
    }

    @Column(name = "OUTTIME")
    public Date getOutTime() {
        return outTime;
    }

    public void setOutTime(Date outTime) {
        this.outTime = outTime;
    }

    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "pgInPgPersonId")
    public PgInPgPerson getPgInPgPersonId() {
        return pgInPgPersonId;
    }

    public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) {
        this.pgInPgPersonId = pgInPgPersonId;
    }

}