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.GenerationType.SEQUENCE;

/**
 * class MapLoginUserToPengendali
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MapPengendaliToJabatan_S")
public class MapPengendaliToJabatan extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectPengendaliFk")
	@NotNull(message = "Kd Pengendali tidak boleh kosong")
	@Caption(value = "Object pengendali")
	private Pengendali pengendali;

	@Column(name = "ObjectPengendaliFk", insertable = false, updatable = false)
	private Integer pengendaliId;

	@ManyToOne
	@JoinColumn(name = "ObjectJabatanFk")
	@NotNull(message = "Jabatan Tidak Boleh Kosong")
	@Caption(value = "Jabatan")
	private Jabatan jabatan;

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

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

}