package com.jasamedika.medifirst2000.entities;

import javax.persistence.*;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@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)
	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;

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

}
