package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class MapLoginUserToPengendali
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "MapLoginUserToPengadaan_S")
public class MapLoginUserToPengadaan extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectPengadaanFk")
	@NotNull(message = "Kd Pengendali tidak boleh kosong")
	@Caption(value = "Object pengendali")
	private Pengadaan pengadaan;

	@Column(name = "ObjectPengadaanFk", insertable = false, updatable = false)
	private Integer pengadaanId;

	@ManyToOne
	@JoinColumn(name = "ObjectLoginUserFk")
	@NotNull(message = "Login User tidak boleh kosong")
	@Caption(value = "Login User")
	private LoginUser loginUser;

	@Column(name = "ObjectLoginUserFk", insertable = false, updatable = false)
	private Integer loginUserId;

	public Pengadaan getPengadaan() {
		return pengadaan;
	}

	public void setPengadaan(Pengadaan pengadaan) {
		this.pengadaan = pengadaan;
	}

	public Integer getPengadaanId() {
		return pengadaanId;
	}

	public void setPengadaanId(Integer pengadaanId) {
		this.pengadaanId = pengadaanId;
	}

	public LoginUser getLoginUser() {
		return loginUser;
	}

	public void setLoginUser(LoginUser loginUser) {
		this.loginUser = loginUser;
	}

	public Integer getLoginUserId() {
		return loginUserId;
	}

	public void setLoginUserId(Integer loginUserId) {
		this.loginUserId = loginUserId;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.maploginusertopengadaan_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.maploginusertopengadaan_m_id_seq", sequenceName = "public.maploginusertopengadaan_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	public Integer getId() {

		return id;
	}

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