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.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

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

@Entity
@Table(name = "PemakaianRuangRapat_T")
public class PemakaianRuangRapat extends BaseTransaction {

	private static final long serialVersionUID = 107148497212654783L;

	@ManyToOne
	@JoinColumn(name = "ObjectStrukOrderFk")
	private StrukOrder strukOrder;

	@Column(name = "ObjectStrukOrderFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String strukOrderId;

	@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "pemakaianRuangRapat")
	@Caption(value = "mapPegawaiRuangRapat")
	private Set<MappingPegawaiPemakaianRuangRapat> mapPegawaiRuangRapat = new HashSet<MappingPegawaiPemakaianRuangRapat>();

	public StrukOrder getStrukOrder() {
		return strukOrder;
	}

	public void setStrukOrder(StrukOrder strukOrder) {
		this.strukOrder = strukOrder;
	}

	public Set<MappingPegawaiPemakaianRuangRapat> getMapPegawaiRuangRapat() {
		return mapPegawaiRuangRapat;
	}

	public void setMapPegawaiRuangRapat(Set<MappingPegawaiPemakaianRuangRapat> mapPegawaiRuangRapat) {
		this.mapPegawaiRuangRapat = mapPegawaiRuangRapat;
	}

}
