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

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
@Table(name = "K3FacillityCheck_M")
public class K3FacillityCheck extends BaseMaster {

	@Caption(value = "Facillity Check")
	@Column(name = "FacillityCheck", length = 50, nullable = false)
	private String facillityCheck;

	@JsonBackReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "k3FacillityCheck")
	private Set<K3KelompokLpjGedung> k3KelompokLpjGedung = new HashSet<>();

	public String getFacillityCheck() {
		return facillityCheck;
	}

	public void setFacillityCheck(String facillityCheck) {
		this.facillityCheck = facillityCheck;
	}

	public Set<K3KelompokLpjGedung> getK3KelompokLpjGedung() {
		return k3KelompokLpjGedung;
	}

	public void setK3KelompokLpjGedung(Set<K3KelompokLpjGedung> k3KelompokLpjGedung) {
		this.k3KelompokLpjGedung = k3KelompokLpjGedung;
	}

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

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
}