package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class MapRuanganToKelas
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@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;

	@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;

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

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

}