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 MapPegawaiToObjekPajak
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MapPegawaiToObjekPajak_M")
public class MapPegawaiToObjekPajak extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectObjekPajakFk")
	@NotNull(message = "Kd Objek Pajak tidak boleh kosong")
	@Caption(value = "Object Objek Pajak")
	private ObjekPajak objekPajak;

	@Column(name = "ObjectObjekPajakFk", insertable = false, updatable = false)
	private Integer objekPajakId;

	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiFk")
	@NotNull(message = "Kd Pegawai tidak boleh kosong")
	@Caption(value = "Object Pegawai")
	private Pegawai pegawai;

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

	@ManyToOne
	@JoinColumn(name = "ObjectRangeFk")
	@NotNull(message = "Kd Range tidak boleh kosong")
	@Caption(value = "Object Range")
	private Range range;

	@Column(name = "ObjectRangeFk", insertable = false, updatable = false, nullable = false)
	private Integer rangeId;

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

}