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

@Getter
@Setter
@Entity
@Table(name = "MapPegawaiToModulAplikasi_S")
public class MapPegawaiToModulAplikasi extends BaseMaster {

	private static final long serialVersionUID = -5956570834138264263L;

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectModulAplikasiFk")
	@Caption(value = "Object Modul Aplikasi")
	private ModulAplikasi modulAplikasi;

	@Column(name = "ObjectModulAplikasiFk", insertable = false, updatable = false)
	private Integer modulAplikasiId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectPegawaiFk")
	@Caption(value = "Object Pegawai")
	private Pegawai pegawai;

	@Column(name = "ObjectPegawaiFk", insertable = false, updatable = false)
	private Integer pegawaiId;

}