package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import java.util.HashSet;
import java.util.Set;

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 JenisKomponenHarga
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisKomponenHarga_M")
public class JenisKomponenHarga extends BaseMaster {
	@NotNull(message = "Jenis Komponen Harga tidak boleh kosong")
	@Column(name = "JenisKomponenHarga", nullable = false, length = 30)
	@Caption(value = "Jenis Komponen Harga")
	private String jenisKomponenHarga;

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

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

	@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;

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

	public void setKdJenisKomponenHarga(Byte kdJenisKomponenHarga) {
		this.kdJenisKomponenHarga = kdJenisKomponenHarga;
	}

	public Byte getKdJenisKomponenHarga() {
		return this.kdJenisKomponenHarga;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisKomponenHargaHeadFk")

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

	public void setJenisKomponenHargaHead(JenisKomponenHarga jenisKomponenHargaHead) {
		this.jenisKomponenHargaHead = jenisKomponenHargaHead;
	}

	public JenisKomponenHarga getJenisKomponenHargaHead() {
		return this.jenisKomponenHargaHead;
	}

	@Column(name = "ObjectJenisKomponenHargaHeadFk", insertable = false, updatable = false)
	private Integer jenisKomponenHargaHeadId;

	@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 = "QJenis Komponen Harga tidak boleh kosong")
	@Column(name = "QJenisKomponenHarga", nullable = false)
	@Caption(value = "QJenis Komponen Harga")
	private Byte qJenisKomponenHarga;

	public void setqJenisKomponenHarga(Byte qJenisKomponenHarga) {
		this.qJenisKomponenHarga = qJenisKomponenHarga;
	}

	public Byte getqJenisKomponenHarga() {
		return this.qJenisKomponenHarga;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjeniskomponenhargahead") private Set<JenisKomponenHarga>
	 * JenisKomponenHargaSet = new HashSet<JenisKomponenHarga>();
	 * 
	 * public Set<JenisKomponenHarga> getJenisKomponenHargaSet() { return
	 * JenisKomponenHargaSet; }
	 * 
	 * public void setJenisKomponenHargaSet(Set<JenisKomponenHarga>
	 * jenisKomponenHargaSet) { JenisKomponenHargaSet = jenisKomponenHargaSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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