package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseTransaction;
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;

/**
 * @author salmanoe
 * @since Jan 11, 2022
 */
@Getter
@Setter
@Entity
@Table(name = "sdm_mapfotoprofilpegawai_t")
public class MapFotoProfilPegawai extends BaseTransaction {

	private static final long serialVersionUID = -2307008333710748465L;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "pegawaifk")
	@NotNull(message = "Pegawai tidak boleh kosong")
	@Caption(value = "Pegawai")
	private Pegawai pegawai;

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

	@Column(name = "filepath", nullable = false)
	private String filePath;

}
