package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class KomponenIndexDetailRange
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "KomponenIndexDetailRange_M")
public class KomponenIndexDetailRange extends BaseMaster {
	@NotNull(message = "Factor Rate Index Range tidak boleh kosong")
	@Column(name = "FactorRateIndexRange", nullable = false)
	@Caption(value = "Factor Rate Index Range")
	private Double factorRateIndexRange;

	public void setFactorRateIndexRange(Double factorRateIndexRange) {
		this.factorRateIndexRange = factorRateIndexRange;
	}

	public Double getFactorRateIndexRange() {
		return this.factorRateIndexRange;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenIndexDetailFk")
	@NotNull(message = "Kd Komponen Index Detail tidak boleh kosong")

	@Caption(value = "Object Komponen Index Detail")
	private KomponenIndex komponenIndexDetail;

	public void setKomponenIndexDetail(KomponenIndex komponenIndexDetail) {
		this.komponenIndexDetail = komponenIndexDetail;
	}

	public KomponenIndex getKomponenIndexDetail() {
		return this.komponenIndexDetail;
	}

	@Column(name = "ObjectKomponenIndexDetailFk", insertable = false, updatable = false)
	private Integer komponenIndexDetailId;

	@ManyToOne
	@JoinColumn(name = "ObjectRangeFk")
	@NotNull(message = "Kd Range tidak boleh kosong")

	@Caption(value = "Object Range")
	private Range range;

	public void setRange(Range range) {
		this.range = range;
	}

	public Range getRange() {
		return this.range;
	}

	@Column(name = "ObjectRangeFk", insertable = false, updatable = false, nullable = false)
	private Integer rangeId;

	@Column(name = "NilaiIndexRange", nullable = true)
	@Caption(value = "Nilai Index Range")
	private Double nilaiIndexRange;

	public void setNilaiIndexRange(Double nilaiIndexRange) {
		this.nilaiIndexRange = nilaiIndexRange;
	}

	public Double getNilaiIndexRange() {
		return this.nilaiIndexRange;
	}

	@Column(name = "PersenNilaiIndexRange", nullable = true)
	@Caption(value = "Persen Nilai Index Range")
	private Double persenNilaiIndexRange;

	public void setPersenNilaiIndexRange(Double persenNilaiIndexRange) {
		this.persenNilaiIndexRange = persenNilaiIndexRange;
	}

	public Double getPersenNilaiIndexRange() {
		return this.persenNilaiIndexRange;
	}

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

	public Integer getId() {

		return id;
	}

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