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

	@NotNull(message = "Jenis Alkes tidak boleh kosong")
	@Column(name = "JenisAlkes", nullable = false, length = 100)
	@Caption(value = "Jenis Alkes")
	private String jenisAlkes;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Kd Departemen tidak boleh kosong")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

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

	@NotNull(message = "Kd Jenis Alkes tidak boleh kosong")
	@Column(name = "KdJenisAlkes", nullable = false)
	@Caption(value = "Kode Jenis Alkes")
	private Byte kdJenisAlkes;

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

}