package com.jasamedika.medifirst2000.entities;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name="Vaksin_T")
public class Vaksin extends BaseTransaction {
	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiFk")
	@NotNull(message="Pegawai tidak boleh kosong")
	@Caption(value="Pegawai")
	private Pegawai pegawai;
	
	@Column(name = "ObjectPegawaiFk", insertable=false,updatable=false,nullable=false)
	private Integer pegawaiId;
	
	@JsonManagedReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "vaksin")
	@Caption(value = "dataVaksinSet")
	private Set<DataVaksin> dataVaksinSet=new HashSet<DataVaksin>();

	public Pegawai getPegawai() {
		return pegawai;
	}

	public void setPegawai(Pegawai pegawai) {
		this.pegawai = pegawai;
	}

	public Integer getPegawaiId() {
		return pegawaiId;
	}

	public void setPegawaiId(Integer pegawaiId) {
		this.pegawaiId = pegawaiId;
	}

	public Set<DataVaksin> getDataVaksinSet() {
		return dataVaksinSet;
	}

	public void setDataVaksinSet(Set<DataVaksin> dataVaksinSet) {
		this.dataVaksinSet = dataVaksinSet;
	}
	
	
}
