package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
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 JenisRange
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisRange_M")
public class JenisRange extends BaseMaster {
	@NotNull(message = "Jenis Range tidak boleh kosong")
	@Column(name = "JenisRange", nullable = false, length = 50)
	@Caption(value = "Jenis Range")
	private String jenisRange;

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

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

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

	public void setKdJenisRange(Byte kdJenisRange) {
		this.kdJenisRange = kdJenisRange;
	}

	public Byte getKdJenisRange() {
		return this.kdJenisRange;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisRangeHeadFk")

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

	public void setJenisRangeHead(JenisRange jenisRangeHead) {
		this.jenisRangeHead = jenisRangeHead;
	}

	public JenisRange getJenisRangeHead() {
		return this.jenisRangeHead;
	}

	@Column(name = "ObjectJenisRangeHeadFk", insertable = false, updatable = false)
	private Integer jenisRangeHeadId;

	@NotNull(message = "QJenis Range tidak boleh kosong")
	@Column(name = "QJenisRange", nullable = false)
	@Caption(value = "QJenis Range")
	private Byte qJenisRange;

	public void setqJenisRange(Byte qJenisRange) {
		this.qJenisRange = qJenisRange;
	}

	public Byte getqJenisRange() {
		return this.qJenisRange;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjenisrangehead") private Set<JenisRange> JenisRangeSet = new
	 * HashSet<JenisRange>();
	 * 
	 * public Set<JenisRange> getJenisRangeSet() { return JenisRangeSet; }
	 * 
	 * public void setJenisRangeSet(Set<JenisRange> jenisRangeSet) {
	 * JenisRangeSet = jenisRangeSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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