package com.jasamedika.medifirst2000.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.envers.Audited;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;import org.hibernate.envers.Audited;

/**
 *  class PenawaranHarga_T
 * 
 * @author Adik
 */
@Entity //@Audited
@Table(name = "PenawaranHarga_T")
public class PenawaranHarga extends BaseTransaction {
	
	@ManyToOne
	@JoinColumn(name = "ObjectRekananFk")
	@Caption(value="Object Rekanan")
	private Rekanan supplier;
	
	@Column(name = "tanggal")
	@Caption(value = "tanggal")
	private Date tanggal;

	@Column(name = "ObjectRekananFk", insertable=false,updatable=false)
	private Integer supplierId;
	
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "penawaranHarga")
	private Set<PenawaranHargaSupplier> penawaranHargaSupplier = new HashSet<PenawaranHargaSupplier>();

	public Rekanan getSupplier() {
		return supplier;
	}

	public void setSupplier(Rekanan supplier) {
		this.supplier = supplier;
	}

	public Integer getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(Integer supplierId) {
		this.supplierId = supplierId;
	}

	public Set<PenawaranHargaSupplier> getPenawaranHargaSupplier() {
		return penawaranHargaSupplier;
	}

	public void setPenawaranHargaSupplier(Set<PenawaranHargaSupplier> penawaranHargaSupplier) {
		this.penawaranHargaSupplier = penawaranHargaSupplier;
	}

	public Date getTanggal() {
		return tanggal;
	}

	public void setTanggal(Date tanggal) {
		this.tanggal = tanggal;
	}
	
	
	
	
}

