package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseMaster;
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 = "MapGolonganPegawaiToKelas_M")
public class MapGolonganPegawaiToKelas extends BaseMaster {

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectGolonganPegawaiFK")
	private Golongan golonganPegawai;

	@Column(name = "ObjectGolonganPegawaiFK", insertable = false, updatable = false)
	private Integer golonganPegawaiId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectKelasFK")
	private Kelas kelas;

	@Column(name = "ObjectKelasFK", insertable = false, updatable = false)
	private Integer kelasId;

}
