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;

@Getter
@Setter
@Entity
@Table(name = "Komponen_M")
public class Komponen extends BaseMaster {

	@NotNull(message = "Komponen tidak boleh kosong")
	@Caption(value = "Komponen")
	@Column(name = "Komponen", length = 200)
	private String namaKomponen;

	@NotNull(message = "Kode Komponen tidak boleh kosong")
	@Caption(value = "Kode Komponen")
	@Column(name = "KodeKomponen", length = 50)
	private String kodeKomponen;

	@NotNull(message = "Keterangan tidak boleh kosong")
	@Caption(value = "Keterangan")
	@Column(name = "Keterangan", length = 200)
	private String ketKomponen;

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

}