package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "Event_M")
public class Event extends BaseMaster{
	@Column(name = "KdEvent", nullable = false)
	@Caption(value = "Kode Event")
	private Byte kdEvent;
	
	@Column(name = "namaEvent", nullable = false)
	@Caption(value = "Nama Event")
	private String namaEvent;
	
	@ManyToOne
	@JoinColumn(name = "eventHeadFk")
	@Caption(value="eventHeadFk")
	private Event eventHead;

	@Column(name = "eventHeadFk", insertable=false,updatable=false,nullable=true)
	private Integer eventHeadId;

	@ManyToOne
	@JoinColumn(name = "departemenFk")
	@Caption(value="departemenFk")
	private Departemen departemen;

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

	public Byte getKdEvent() {
		return kdEvent;
	}

	public void setKdEvent(Byte kdEvent) {
		this.kdEvent = kdEvent;
	}

	public String getNamaEvent() {
		return namaEvent;
	}

	public void setNamaEvent(String namaEvent) {
		this.namaEvent = namaEvent;
	}

	public Event getEventHead() {
		return eventHead;
	}

	public void setEventHead(Event eventHead) {
		this.eventHead = eventHead;
	}

	public Integer getEventHeadId() {
		return eventHeadId;
	}

	public void setEventHeadId(Integer eventHeadId) {
		this.eventHeadId = eventHeadId;
	}

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

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

	public Integer getId() {
		return id;
	}

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