package kr.co.kihyun.beans.entity;

import java.util.Date;

import javax.jdo.JDOObjectNotFoundException;
import javax.jdo.PersistenceManager;
import javax.jdo.annotations.*;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Repoadm extends LongEntity {

	private static final long serialVersionUID = 3878060394426306113L;

	@Persistent
	private TotReport totReport;

	@Persistent
	private String recogUser;

	@Persistent
	private Recog recog = Recog.NOT_RECOG;

	@Persistent(customValueStrategy = "timestamp")
	private Date decDate;

	@Persistent
	private String history;

	@Persistent
	private int recogNum = 0;

	public Repoadm() {
	}

	public TotReport getTotReport() {
		return this.totReport;
	}

	public void setTotReport(TotReport totReport) {
		this.totReport = totReport;
	}

	public MUser getRecogUser(PersistenceManager pm) {
		try {
			return pm.getObjectById(MUser.class, this.recogUser);
		} catch (JDOObjectNotFoundException jonfe) {
			return null;
		}
	}

	public void setRecogUser(MUser recogUser) {
		if (recogUser == null)
			this.recogUser = null;
		else
			this.recogUser = recogUser.getId();
	}

	public Recog getRecog() {
		return this.recog;
	}

	public void setRecog(Recog recog) {
		this.recog = recog;
	}

	public Date getDecDate() {
		return this.decDate;
	}

	public void setDecDate(Date date) {
		this.decDate = date;
	}

	public String getHistory() {
		return this.history;
	}

	public void setHistory(String history) {
		this.history = history;
	}

	public int getRecogNum() {
		return this.recogNum;
	}

	public void setRecogNum(int recogNum) {
		this.recogNum = recogNum;
	}
}
