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

	@NotNull(message = "Jenis Range tidak boleh kosong")
	@Column(name = "JenisRange", nullable = false, length = 50)
	@Caption(value = "Jenis Range")
	private String jenisRange;

	@NotNull(message = "Kd Jenis Range tidak boleh kosong")
	@Column(name = "KdJenisRange", nullable = false)
	@Caption(value = "Kode Jenis Range")
	private Byte kdJenisRange;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisRangeHeadFk")
	@Caption(value = "Object Jenis Range Head")
	private JenisRange jenisRangeHead;

	@Column(name = "ObjectJenisRangeHeadFk", insertable = false, updatable = false)
	private Integer jenisRangeHeadId;

	@NotNull(message = "QJenis Range tidak boleh kosong")
	@Column(name = "QJenisRange", nullable = false)
	@Caption(value = "QJenis Range")
	private Byte qJenisRange;

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

}