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.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

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

@Entity
@Table(name = "Range_M")
public class RangeMasaKerja extends BaseMaster {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.range_m_id_seq")
	@SequenceGenerator(name = "public.range_m_id_seq", sequenceName = "public.range_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	private Integer id;
	
	@NotNull(message = "Kode Range tidak boleh kosong")
	@Column(name = "KdRange", nullable = false)
	@Caption("Kode Range")
	private String kdRange;
	
	@NotNull(message = "Nama Range tidak boleh konsong")
	@Column(name = "NamaRange", nullable = false)
	@Caption("Nama Range")
	private String namaRange;
	
	@NotNull(message = "Range Min tidak boleh kosong")
	@Column(name = "RangeMin", nullable = false)
	@Caption("Range Min")
	private Byte rangeMin;
	
	@NotNull(message = "Range Max tidak boleh kosong")
	@Column(name = "RangeMax", nullable = false)
	@Caption("Range Max")
	private Byte rangeMax;
	
	@ManyToOne
	@JoinColumn(name = "ObjectJenisRangeFk")
	@Caption("ObjectJenisRangeFk")
	private JenisRange jenisRange;

	@Column(name = "ObjectJenisRangeFk", insertable = false, updatable = false)
	private Integer jenisRangeId;
	
	public Integer getId() {
		return id;
	}

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

	public String getKdRange() {
		return kdRange;
	}

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

	public String getNamaRange() {
		return namaRange;
	}

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

	public Byte getRangeMin() {
		return rangeMin;
	}

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

	public Byte getRangeMax() {
		return rangeMax;
	}

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

	public JenisRange getJenisRange() {
		return jenisRange;
	}

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

	public Integer getJenisRangeId() {
		return jenisRangeId;
	}

	public void setJenisRangeId(Integer jenisRangeId) {
		this.jenisRangeId = jenisRangeId;
	}
	
}
