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 = "IpsrsJenisPemakaian_M")
public class IpsrsJenisPemakaian extends BaseMaster {

	@Caption(value = "JenisPemakaian")
	@Column(name = "JenisPemakaian", nullable = false)
	private String jenisPemakaian;

	@JsonBackReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ipsrsJenisPemakaian")
	Set<IpsrsKapasitasJenisPemakaian> ipsrsKapasitasJenisPemakaian = new HashSet<>();

	public String getJenisPemakaian() {
		return jenisPemakaian;
	}

	public void setJenisPemakaian(String jenisPemakaian) {
		this.jenisPemakaian = jenisPemakaian;
	}

	public Set<IpsrsKapasitasJenisPemakaian> getIpsrsKapasitasJenisPemakaian() {
		return ipsrsKapasitasJenisPemakaian;
	}

	public void setIpsrsKapasitasJenisPemakaian(Set<IpsrsKapasitasJenisPemakaian> ipsrsKapasitasJenisPemakaian) {
		this.ipsrsKapasitasJenisPemakaian = ipsrsKapasitasJenisPemakaian;
	}

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

	public Integer getId() {

		return id;
	}

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