package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class MapRuanganToKelas
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "MapRuanganToKelas_M")
public class MapRuanganToKelas extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectKelasFk")
	@NotNull(message = "Kd Kelas tidak boleh kosong")

	@Caption(value = "Object Kelas")
	private Kelas kelas;

	public void setKelas(Kelas kelas) {
		this.kelas = kelas;
	}

	public Kelas getKelas() {
		return this.kelas;
	}

	@Column(name = "ObjectKelasFk", insertable = false, updatable = false)
	private Integer kelasId;

	@ManyToOne
	@JoinColumn(name = "ObjectRuanganFk")
	@NotNull(message = "Kd Ruangan tidak boleh kosong")
	@Caption(value = "Object Ruangan")
	private Ruangan ruangan;

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

	public Ruangan getRuangan() {
		return this.ruangan;
	}

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

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

	public Integer getId() {

		return id;
	}

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