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

	@NotNull(message = "Jenis Hukuman tidak boleh kosong")
	@Column(name = "JenisHukuman", nullable = false, length = 50)
	@Caption(value = "Jenis Hukuman")
	private String jenisHukuman;

	@NotNull(message = "Kd Jenis Hukuman tidak boleh kosong")
	@Column(name = "KdJenisHukuman", nullable = false)
	@Caption(value = "Kode Jenis Hukuman")
	private Byte kdJenisHukuman;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisHukumanHeadFk")
	@Caption(value = "Object Jenis Hukuman Head")
	private JenisHukuman jenisHukumanHead;

	@Column(name = "ObjectJenisHukumanHeadFk", insertable = false, updatable = false)
	private Integer jenisHukumanHeadId;

	@NotNull(message = "QJenis Hukuman tidak boleh kosong")
	@Column(name = "QJenisHukuman", nullable = false)
	@Caption(value = "QJenis Hukuman")
	private Byte qJenisHukuman;

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

}