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 DetailKamar
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "DetailKamar_M")
public class DetailKamar extends BaseMaster {

	@NotNull(message = "Fasilitas tidak boleh kosong")
	@Column(name = "Fasilitas", nullable = false)
	@Caption(value = "Fasilitas")
	private String fasilitas;

	@Column(name = "Gambar")
	@Caption(value = "Gambar")
	private String gambar;

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

	@NotNull(message = "Qty Kamar tidak boleh kosong")
	@Column(name = "QtyKamar", nullable = false)
	@Caption(value = "Qty Kamar")
	private short qtyKamar;

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

}