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 KomponenHarga
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "KomponenHarga_M")
public class KomponenHarga extends BaseMaster {
	private static final long serialVersionUID = 2283865782290922330L;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")

	@Caption(value = "Object Departemen")
	private Departemen departemen;

	public void setDepartemen(Departemen departemen) {
		this.departemen = departemen;
	}

	public Departemen getDepartemen() {
		return this.departemen;
	}

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisKomponenHargaFk")
	@NotNull(message = "Kd Jenis Komponen Harga tidak boleh kosong")

	@Caption(value = "Object Jenis Komponen Harga")
	private JenisKomponenHarga jenisKomponenHarga;

	public void setJenisKomponenHarga(JenisKomponenHarga jenisKomponenHarga) {
		this.jenisKomponenHarga = jenisKomponenHarga;
	}

	public JenisKomponenHarga getJenisKomponenHarga() {
		return this.jenisKomponenHarga;
	}

	@Column(name = "ObjectJenisKomponenHargaFk", insertable = false, updatable = false)
	private Integer jenisKomponenHargaId;

	@NotNull(message = "Kd Komponen Harga tidak boleh kosong")
	@Column(name = "KdKomponenHarga", nullable = false)
	@Caption(value = "Kode Komponen Harga")
	private Byte kdKomponenHarga;

	public void setKdKomponenHarga(Byte kdKomponenHarga) {
		this.kdKomponenHarga = kdKomponenHarga;
	}

	public Byte getKdKomponenHarga() {
		return this.kdKomponenHarga;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectProdukPKFk")

	@Caption(value = "Object Produk P K")
	private Produk produkPK;

	public void setProdukPK(Produk produkPK) {
		this.produkPK = produkPK;
	}

	public Produk getProdukPK() {
		return this.produkPK;
	}

	@Column(name = "ObjectProdukPKFk", insertable = false, updatable = false, nullable = false)
	private Integer produkPKId;

	@NotNull(message = "Komponen Harga tidak boleh kosong")
	@Column(name = "KomponenHarga", nullable = false, length = 20)
	@Caption(value = "Komponen Harga")
	private String komponenHarga;

	public void setKomponenHarga(String komponenHarga) {
		this.komponenHarga = komponenHarga;
	}

	public String getKomponenHarga() {
		return this.komponenHarga;
	}

	@Column(name = "NilaiNormal", nullable = true)
	@Caption(value = "Nilai Normal")
	private short nilaiNormal;

	public void setNilaiNormal(short nilaiNormal) {
		this.nilaiNormal = nilaiNormal;
	}

	public short getNilaiNormal() {
		return this.nilaiNormal;
	}

	@NotNull(message = "No Urut tidak boleh kosong")
	@Column(name = "NoUrut", nullable = false)
	@Caption(value = "No Urut")
	private Byte noUrut;

	public void setNoUrut(Byte noUrut) {
		this.noUrut = noUrut;
	}

	public Byte getNoUrut() {
		return this.noUrut;
	}

	@NotNull(message = "QKomponen Harga tidak boleh kosong")
	@Column(name = "QKomponenHarga", nullable = false)
	@Caption(value = "QKomponen Harga")
	private Byte qKomponenHarga;

	public void setqKomponenHarga(Byte qKomponenHarga) {
		this.qKomponenHarga = qKomponenHarga;
	}

	public Byte getqKomponenHarga() {
		return this.qKomponenHarga;
	}
	
	@Column(name="FactorRate")
	@Caption(value="Factor Rate")
	private Integer factorRate;
	
	@Column(name="OperatorFactorRate")
	@Caption(value="Operator Factor Rate")
	private String operatorFactorRate;

	public Integer getFactorRate() {
		return factorRate;
	}


	public void setFactorRate(Integer factorRate) {
		this.factorRate = factorRate;
	}


	public String getOperatorFactorRate() {
		return operatorFactorRate;
	}


	public void setOperatorFactorRate(String operatorFactorRate) {
		this.operatorFactorRate = operatorFactorRate;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdkomponenharga") private Set<HargaNettoDiscPasienPulang>
	 * HargaNettoDiscPasienPulangSet = new
	 * HashSet<HargaNettoDiscPasienPulang>();
	 * 
	 * public Set<HargaNettoDiscPasienPulang> getHargaNettoDiscPasienPulangSet()
	 * { return HargaNettoDiscPasienPulangSet; }
	 * 
	 * public void
	 * setHargaNettoDiscPasienPulangSet(Set<HargaNettoDiscPasienPulang>
	 * hargaNettoDiscPasienPulangSet) { HargaNettoDiscPasienPulangSet =
	 * hargaNettoDiscPasienPulangSet; }
	 * 
	 * 
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdkomponenharga") private Set<HargaNettoProdukByKelasD>
	 * HargaNettoProdukByKelasDSet = new HashSet<HargaNettoProdukByKelasD>();
	 * 
	 * public Set<HargaNettoProdukByKelasD> getHargaNettoProdukByKelasDSet() {
	 * return HargaNettoProdukByKelasDSet; }
	 * 
	 * public void setHargaNettoProdukByKelasDSet(Set<HargaNettoProdukByKelasD>
	 * hargaNettoProdukByKelasDSet) { HargaNettoProdukByKelasDSet =
	 * hargaNettoProdukByKelasDSet; }
	 * 
	 * 
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdkomponenharga") private Set<HargaNettoProdukCitoD>
	 * HargaNettoProdukCitoDSet = new HashSet<HargaNettoProdukCitoD>();
	 * 
	 * public Set<HargaNettoProdukCitoD> getHargaNettoProdukCitoDSet() { return
	 * HargaNettoProdukCitoDSet; }
	 * 
	 * public void setHargaNettoProdukCitoDSet(Set<HargaNettoProdukCitoD>
	 * hargaNettoProdukCitoDSet) { HargaNettoProdukCitoDSet =
	 * hargaNettoProdukCitoDSet; }
	 * 
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdkomponenharga") private Set<JenisPetugasPelaksana>
	 * JenisPetugasPelaksanaSet = new HashSet<JenisPetugasPelaksana>();
	 * 
	 * public Set<JenisPetugasPelaksana> getJenisPetugasPelaksanaSet() { return
	 * JenisPetugasPelaksanaSet; }
	 * 
	 * public void setJenisPetugasPelaksanaSet(Set<JenisPetugasPelaksana>
	 * jenisPetugasPelaksanaSet) { JenisPetugasPelaksanaSet =
	 * jenisPetugasPelaksanaSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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