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

	@NotNull(message = "Jenis Rekanan tidak boleh kosong")
	@Column(name = "JenisRekanan", nullable = false, length = 30)
	@Caption(value = "Jenis Rekanan")
	private String namaJenisRekanan;

	@NotNull(message = "Kd Jenis Rekanan tidak boleh kosong")
	@Column(name = "KdJenisRekanan", nullable = false)
	@Caption(value = "Kode Jenis Rekanan")
	private Byte kdJenisRekanan;

	@NotNull(message = "QJenis Rekanan tidak boleh kosong")
	@Column(name = "QJenisRekanan", nullable = false)
	@Caption(value = "QJenis Rekanan")
	private Byte qJenisRekanan;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisRekananHead")
	@Caption(value = "Object Jenis Rekanan")
	private JenisRekanan jenisRekanan;

	@Column(name = "ObjectJenisRekananHead", insertable = false, updatable = false)
	private Integer jenisRekananId;

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

}