package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;

/**
 * class Range
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "Range_M")
public class Range extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectJenisRangeFk")
	@NotNull(message = "Kd Jenis Range tidak boleh kosong")

	@Caption(value = "Object Jenis Range")
	private JenisRange jenisRange;

	public void setJenisRange(JenisRange jenisRange) {
		this.jenisRange = jenisRange;
	}

	public JenisRange getJenisRange() {
		return this.jenisRange;
	}

	@Column(name = "ObjectJenisRangeFk", insertable = false, updatable = false)
	private Integer jenisRangeId;

	@NotNull(message = "Kd Range tidak boleh kosong")
	@Column(name = "KdRange", nullable = false)
	@Caption(value = "Kode Range")
	private Byte kdRange;

	public void setKdRange(Byte kdRange) {
		this.kdRange = kdRange;
	}

	public Byte getKdRange() {
		return this.kdRange;
	}

	@Column(name = "NamaRange", nullable = true, length = 30)
	@Caption(value = "Nama Range")
	private String namaRange;

	public void setNamaRange(String namaRange) {
		this.namaRange = namaRange;
	}

	public String getNamaRange() {
		return this.namaRange;
	}

	@NotNull(message = "QRange tidak boleh kosong")
	@Column(name = "QRange", nullable = false)
	@Caption(value = "QRange")
	private Byte qRange;

	public void setqRange(Byte qRange) {
		this.qRange = qRange;
	}

	public Byte getqRange() {
		return this.qRange;
	}

	@NotNull(message = "Range Max tidak boleh kosong")
	@Column(name = "RangeMax", nullable = false)
	@Caption(value = "Range Max")
	private Double rangeMax;

	public void setRangeMax(Double rangeMax) {
		this.rangeMax = rangeMax;
	}

	public Double getRangeMax() {
		return this.rangeMax;
	}

	@NotNull(message = "Range Min tidak boleh kosong")
	@Column(name = "RangeMin", nullable = false)
	@Caption(value = "Range Min")
	private Double rangeMin;

	public void setRangeMin(Double rangeMin) {
		this.rangeMin = rangeMin;
	}

	public Double getRangeMin() {
		return this.rangeMin;
	}
	
	@ManyToOne(fetch=FetchType.LAZY)
	@Caption("Satuan Standar")
	@JoinColumn(name="ObjectSatuanStandarFk")
	private SatuanStandar satuanStandar;
	
	@Column(name="ObjectSatuanStandarFk", nullable=true, insertable=false, updatable=false)
	private Integer satuanStandarId;
	
	public SatuanStandar getSatuanStandar() {
		return satuanStandar;
	}

	public void setSatuanStandar(SatuanStandar satuanStandar) {
		this.satuanStandar = satuanStandar;
	}

	public Integer getSatuanStandarId() {
		return satuanStandarId;
	}

	public void setSatuanStandarId(Integer satuanStandarId) {
		this.satuanStandarId = satuanStandarId;
	}
	
	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdrange") private Set<HargaNettoDiscPasienPulang>
	 * HargaNettoDiscPasienPulangSet = new
	 * HashSet<HargaNettoDiscPasienPulang>();
	 * 
	 * public Set<HargaNettoDiscPasienPulang> getHargaNettoDiscPasienPulangSet()
	 * { return HargaNettoDiscPasienPulangSet; }
	 * 
	 * public void
	 * setHargaNettoDiscPasienPulangSet(Set<HargaNettoDiscPasienPulang>
	 * hargaNettoDiscPasienPulangSet) { HargaNettoDiscPasienPulangSet =
	 * hargaNettoDiscPasienPulangSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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


}