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;

@Entity
@Table(name = "RisikoKerjaRuangan_M")
public class RisikoKerjaRuangan extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectRuanganFk")
	@NotNull(message = "Ruangan tidak boleh kosong")
	@Caption(value = "Ruangan")
	private Ruangan ruangan;

	@Column(name = "ObjectRuanganFk", insertable = false, updatable = false)
	private Integer ruanganId;

	@ManyToOne
	@JoinColumn(name = "ObjectStatusRisikoKerjaFk")
	@NotNull(message = "Status Risiko Kerjatidak boleh kosong")
	@Caption(value = "Status Risiko Kerja")
	private StatusRisikoKerja statusRisikoKerja;

	@Column(name = "ObjectRuanganFk", insertable = false, updatable = false)
	private Integer risikoKerjaId;

	public Ruangan getRuangan() {
		return ruangan;
	}

	public void setRuangan(Ruangan ruangan) {
		this.ruangan = ruangan;
	}

	public StatusRisikoKerja getStatusRisikoKerja() {
		return statusRisikoKerja;
	}

	public void setStatusRisikoKerja(StatusRisikoKerja statusRisikoKerja) {
		this.statusRisikoKerja = statusRisikoKerja;
	}

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

	public Integer getId() {

		return id;
	}

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