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

	@Column(name = "JamAkhir", nullable = false)
	@Caption(value = "Jam Akhir")
	private Byte jamAkhir;

	@Column(name = "JamAwal", nullable = false)
	@Caption(value = "Jam Awal")
	private Byte jamAwal;

	@NotNull(message = "Jenis Waktu tidak boleh kosong")
	@Column(name = "JenisWaktu", nullable = false, length = 10)
	@Caption(value = "Jenis Waktu")
	private String jenisWaktu;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@NotNull(message = "Kd Jenis Waktu tidak boleh kosong")
	@Column(name = "KdJenisWaktu", nullable = false)
	@Caption(value = "Kode Jenis Waktu")
	private Byte kdJenisWaktu;

	@ManyToOne
	@JoinColumn(name = "ObjectKelompokProdukFk")
	@Caption(value = "Object Kelompok Produk")
	private KelompokProduk kelompokProduk;

	@Column(name = "ObjectKelompokProdukFk", insertable = false, updatable = false)
	private Integer kelompokProdukId;

	@Column(name = "NoUrut", nullable = false)
	@Caption(value = "No Urut")
	private Byte noUrut;

	@Column(name = "QJenisWaktu", nullable = false)
	@Caption(value = "QJenis Waktu")
	private Byte qJenisWaktu;

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

}