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 TitlePegawai
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "TitlePegawai_M")
public class TitlePegawai extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectTitleFk")
	@NotNull(message = "Object Title Harus Diisi")
	@Caption(value = "Object Title")
	private TitlePasien title;

	@Column(name = "ObjectTitleFk", insertable = false, updatable = false)
	private Integer titleId;

	@NotNull(message = "Nama Title tidak boleh kosong")
	@Column(name = "NamaTitle", nullable = false, length = 10)
	@Caption(value = "Nama Title")
	private String namaTitle;

	public void setNamaTitle(String namaTitle) {
		this.namaTitle = namaTitle;
	}

	public String getNamaTitle() {
		return this.namaTitle;
	}

	@NotNull(message = "QTitle tidak boleh kosong")
	@Column(name = "QTitle", nullable = false)
	@Caption(value = "QTitle")
	private Byte qTitle;

	public void setqTitle(Byte qTitle) {
		this.qTitle = qTitle;
	}

	public Byte getqTitle() {
		return this.qTitle;
	}

	public Integer getTitleId() {
		return titleId;
	}

	@NotNull(message = "Kd Title tidak boleh kosong")
	@Column(name = "KdTitle", nullable = false)
	public TitlePasien getTitle() {
		return title;
	}

	public void setitle(TitlePasien title) {
		this.title = title;
	}

	public void setitleId(Integer titleId) {
		this.titleId = titleId;
	}

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

	public Integer getId() {

		return id;
	}

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