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.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;

@Entity
@Table(name = "JenisOrder_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class JenisOrder extends BaseMaster {
	
	@NotNull(message = "Jenis Order tidak boleh kosong")
	@Column(name = "JenisOrder", nullable = false, length = 50)
	@Caption(value = "Jenis Order")
	private String jenisOrder;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Kd Departemen tidak boleh kosong")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

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

	@NotNull(message = "Kd Jenis Order tidak boleh kosong")
	@Column(name = "KdJenisOrder", nullable = false)
	@Caption(value = "Kode Jenis Order")
	private Byte kdJenisOrder;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectJenisOrderHeadFk")
	@Caption(value = "Object Jenis Order Head")
	private JenisOrder jenisOrderHead;

	@Column(name = "ObjectJenisOrderHeadFk", insertable = false, updatable = false, nullable = false)
	private Integer jenisOrderHeadId;

	@NotNull(message = "QJenis Order tidak boleh kosong")
	@Column(name = "QJenisOrder", nullable = false)
	@Caption(value = "QJenis Order")
	private Byte qJenisOrder;

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

	public String getJenisOrder() {
		return jenisOrder;
	}

	public void setJenisOrder(String jenisOrder) {
		this.jenisOrder = jenisOrder;
	}

	public Departemen getDepartemen() {
		return departemen;
	}

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

	public Integer getDepartemenId() {
		return departemenId;
	}

	public void setDepartemenId(Integer departemenId) {
		this.departemenId = departemenId;
	}

	public Byte getKdJenisOrder() {
		return kdJenisOrder;
	}

	public void setKdJenisOrder(Byte kdJenisOrder) {
		this.kdJenisOrder = kdJenisOrder;
	}

	public JenisOrder getJenisOrderHead() {
		return jenisOrderHead;
	}

	public void setJenisOrderHead(JenisOrder jenisOrderHead) {
		this.jenisOrderHead = jenisOrderHead;
	}

	public Integer getJenisOrderHeadId() {
		return jenisOrderHeadId;
	}

	public void setJenisOrderHeadId(Integer jenisOrderHeadId) {
		this.jenisOrderHeadId = jenisOrderHeadId;
	}

	public Byte getqJenisOrder() {
		return qJenisOrder;
	}

	public void setqJenisOrder(Byte qJenisOrder) {
		this.qJenisOrder = qJenisOrder;
	}

	public Integer getId() {
		return id;
	}

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

}