package kr.co.kihyun.beans.entity;

import java.io.Serializable;

import javax.jdo.JDOObjectNotFoundException;
import javax.jdo.PersistenceManager;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

@PersistenceCapable(identityType = IdentityType.NONDURABLE)
public class Emul implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8822431671916149046L;

	@Persistent
	private String mUser;

	@Persistent
	private String mDept;

	public Emul() {
	}

//	public void setmUser(MUser mUser) {
//		if (mUser == null)
//			this.mUser = null;
//		else
//			this.mUser = mUser.getId();
//	}

	public MUser getmUser(PersistenceManager pm) {
		try {
			return pm.getObjectById(MUser.class, mUser);
		} catch (JDOObjectNotFoundException jonfe) {
			return null;
		}
	}

//	public void setmDept(MDept mDept) {
//		if (mDept == null)
//			this.mDept = null;
//		else
//			this.mDept = mDept.getId();
//	}

	public MDept getmDept(PersistenceManager pm) {
		try {
			return pm.getObjectById(MDept.class, mDept);
		} catch (JDOObjectNotFoundException jonfe) {
			return null;
		}
	}

}
