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

	@NotNull(message = "Golongan Darah tidak boleh kosong")
	@Column(name = "GolonganDarah", nullable = false, length = 2)
	@Caption(value = "Golongan Darah")
	private String golonganDarah;

	@NotNull(message = "Kd Golongan Darah tidak boleh kosong")
	@Column(name = "KdGolonganDarah", nullable = false)
	@Caption(value = "Kode Golongan Darah")
	private Byte kdGolonganDarah;

	@NotNull(message = "QGolongan Darah tidak boleh kosong")
	@Column(name = "QGolonganDarah", nullable = false)
	@Caption(value = "QGolongan Darah")
	private Byte qGolonganDarah;

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

}