package com.jasamedika.medifirst2000.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;

/**
 * class TempatTidur
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "TempatTidur_M")
public class TempatTidur extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectKamarFk")
	@NotNull(message = "Kd Kamar tidak boleh kosong")

	@Caption(value = "Object Kamar")
	private Kamar kamar;

	public void setKamar(Kamar kamar) {
		this.kamar = kamar;
	}

	public Kamar getKamar() {
		return this.kamar;
	}

	@Column(name = "ObjectKamarFk", insertable = false, updatable = false)
	private Integer kamarId;

	@ManyToOne
	@JoinColumn(name = "ObjectStatusBedFk")
	@NotNull(message = "Kd Status Bed tidak boleh kosong")

	@Caption(value = "Object Status Bed")
	private StatusBed statusBed;

	public void setStatusBed(StatusBed statusBed) {
		this.statusBed = statusBed;
	}

	public StatusBed getStatusBed() {
		return this.statusBed;
	}

	@Column(name = "ObjectStatusBedFk", insertable = false, updatable = false, nullable = false)
	private Integer statusBedId;

	@NotNull(message = "Nomor Bed tidak boleh kosong")
	@Column(name = "NomorBed", nullable = false)
	@Caption(value = "Nomor Bed")
	private Byte nomorBed;

	public void setNomorBed(Byte nomorBed) {
		this.nomorBed = nomorBed;
	}

	public Byte getNomorBed() {
		return this.nomorBed;
	}

	public Integer getKamarId() {
		return kamarId;
	}

	public void setKamarId(Integer kamarId) {
		this.kamarId = kamarId;
	}

	public Integer getStatusBedId() {
		return statusBedId;
	}

	public void setStatusBedId(Integer statusBedId) {
		this.statusBedId = statusBedId;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRuangPerawatanKemenkesFk",nullable = true)
	@Caption(value = "RuangPerawatanKemenkes")
	private RuangPerawatanKemenkes ruangPerawatanKemenkes;

	public RuangPerawatanKemenkes getRuangPerawatanKemenkes() {
		return ruangPerawatanKemenkes;
	}

	public void setRuangPerawatanKemenkes(RuangPerawatanKemenkes ruangPerawatanKemenkes) {
		this.ruangPerawatanKemenkes = ruangPerawatanKemenkes;
	}
	
	@Column(name = "ObjectRuangPerawatanKemenkesFk", insertable = false, updatable = false)
	private Integer ruangPerawatanKemenkesId;
	
	public Integer getRuangPerawatanKemenkesId() {
		return ruangPerawatanKemenkesId;
	}

	public void setRuangPerawatanKemenkesId(Integer ruangPerawatanKemenkesId) {
		this.ruangPerawatanKemenkesId = ruangPerawatanKemenkesId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createddate")
	@Caption(value = "Created Date")
	private Date createdDate;

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

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

	public Integer getId() {

		return id;
	}

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