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

	@NotNull(message = "Jenis Organisasi tidak boleh kosong")
	@Column(name = "JenisOrganisasi", nullable = false, length = 80)
	@Caption(value = "Jenis Organisasi")
	private String jenisOrganisasi;

	@NotNull(message = "Kd Jenis Organisasi tidak boleh kosong")
	@Column(name = "KdJenisOrganisasi", nullable = false)
	@Caption(value = "Kode Jenis Organisasi")
	private Byte kdJenisOrganisasi;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisOrganisasiHeadFk")
	@Caption(value = "Object Jenis Organisasi Head")
	private JenisOrganisasi jenisOrganisasiHead;

	@Column(name = "ObjectJenisOrganisasiHeadFk", insertable = false, updatable = false)
	private Integer jenisOrganisasiHeadId;

	@NotNull(message = "QJenis Organisasi tidak boleh kosong")
	@Column(name = "QJenisOrganisasi", nullable = false)
	@Caption(value = "QJenis Organisasi")
	private Byte qJenisOrganisasi;

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

}