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.google.gson.annotations.Expose;
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 JenisRekanan
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisRekanan_M")
public class JenisRekanan extends BaseMaster {
	@NotNull(message = "Jenis Rekanan tidak boleh kosong")
	@Column(name = "JenisRekanan", nullable = false, length = 30)
	@Caption(value = "Jenis Rekanan")
	private String namaJenisRekanan;

	@NotNull(message = "Kd Jenis Rekanan tidak boleh kosong")
	@Column(name = "KdJenisRekanan", nullable = false)
	@Caption(value = "Kode Jenis Rekanan")
	private Byte kdJenisRekanan;

	@NotNull(message = "QJenis Rekanan tidak boleh kosong")
	@Column(name = "QJenisRekanan", nullable = false)
	@Caption(value = "QJenis Rekanan")
	private Byte qJenisRekanan;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisRekananHead")
	@Caption(value = "Object Jenis Rekanan")
	private JenisRekanan jenisRekanan;

	@Column(name = "ObjectJenisRekananHead", insertable = false, updatable = false)
	private Integer jenisRekananId;

	public String getNamaJenisRekanan() {
		return namaJenisRekanan;
	}

	public void setNamaJenisRekanan(String namaJenisRekanan) {
		this.namaJenisRekanan = namaJenisRekanan;
	}

	public Byte getKdJenisRekanan() {
		return kdJenisRekanan;
	}

	public void setKdJenisRekanan(Byte kdJenisRekanan) {
		this.kdJenisRekanan = kdJenisRekanan;
	}

	public Byte getqJenisRekanan() {
		return qJenisRekanan;
	}

	public void setqJenisRekanan(Byte qJenisRekanan) {
		this.qJenisRekanan = qJenisRekanan;
	}

	public JenisRekanan getJenisRekanan() {
		return jenisRekanan;
	}

	public void setJenisRekanan(JenisRekanan jenisRekanan) {
		this.jenisRekanan = jenisRekanan;
	}

	public Integer getJenisRekananId() {
		return jenisRekananId;
	}

	public void setJenisRekananId(Integer jenisRekananId) {
		this.jenisRekananId = jenisRekananId;
	}

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

	public Integer getId() {

		return id;
	}

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