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 MapAccountToProdukPelayanan
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "MapAccountToProdukPelayanan_M")
public class MapAccountToProdukPelayanan extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectAccountFk")
	@NotNull(message = "Kd Account tidak boleh kosong")

	@Caption(value = "Object Account")
	private ChartOfAccount account;

	public void setAccount(ChartOfAccount account) {
		this.account = account;
	}

	public ChartOfAccount getAccount() {
		return this.account;
	}

	@Column(name = "ObjectAccountFk", insertable = false, updatable = false)
	private Integer accountId;

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

	@Caption(value = "Object Komponen Harga")
	private KomponenHarga komponenHarga;

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

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

	@Column(name = "ObjectKomponenHargaFk", insertable = false, updatable = false, nullable = false)
	private Integer komponenHargaId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Kd Produk tidak boleh kosong")

	@Caption(value = "Object Produk")
	private Produk produk;

	public void setProduk(Produk produk) {
		this.produk = produk;
	}

	public Produk getProduk() {
		return this.produk;
	}

	@Column(name = "ObjectProdukFk", insertable = false, updatable = false, nullable = false)
	private Integer produkId;

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

	public Integer getId() {

		return id;
	}

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