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.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class KelompokUser
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "KelompokUser_S")
public class KelompokUser extends BaseMaster {

	@NotNull(message = "Kd Kelompok User tidak boleh kosong")
	@Column(name = "KdKelompokUser", nullable = false)
	@Caption(value = "Kode Kelompok User")
	private Byte kdKelompokUser;

	@NotNull(message = "Kelompok User tidak boleh kosong")
	@Column(name = "KelompokUser", nullable = false, length = 20)
	@Caption(value = "Kelompok User")
	private String kelompokUser;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objecthistoryloginifk")
	@Caption(value = "History Login Modul Aplikasi I")
	private HistoryLoginModulAplikasi historyLoginModulAplikasiI;

	@Column(name = "objecthistoryloginifk", insertable = false, updatable = false)
	private Integer historyLoginModulAplikasiIId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objecthistoryloginsfk")
	@Caption(value = "History Login Modul Aplikasi S")
	private HistoryLoginModulAplikasi historyLoginModulAplikasiS;

	@Column(name = "objecthistoryloginsfk", insertable = false, updatable = false)
	private Integer historyLoginModulAplikasiSId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objecthistoryloginufk")
	@Caption(value = "History Login Modul Aplikasi U")
	private HistoryLoginModulAplikasi historyLoginModulAplikasiU;

	@Column(name = "objecthistoryloginufk", insertable = false, updatable = false)
	private Integer historyLoginModulAplikasiUId;

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