package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

import static javax.persistence.FetchType.LAZY;

@Getter
@Setter
@Entity
@Table(name = "DisposisiJabatan_T")
public class DisposisiJabatan extends BaseTransaction {

	@JsonBackReference
	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectDisposisiFk")
	@Caption(value = "disposisi")
	private Disposisi disposisi;

	@Column(name = "ObjectDisposisiFk", insertable = false, updatable = false)
	private String disposisiId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectJabatanFk")
	@Caption(value = "jabatan")
	private Jabatan jabatan;

	@Column(name = "ObjectJabatanFk", insertable = false, updatable = false)
	private Integer jabatanId;

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

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

}
