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 = "Asal_M")
public class Asal extends BaseMaster{
	@Column(name = "kdAsal", nullable = false)
	@Caption(value = "kdAsal")
	private Byte kdAsal;
	
	@Column(name = "namaAsal", nullable = false)
	@Caption(value = "namaAsal")
	private String namaAsal;
	
	@ManyToOne
	@JoinColumn(name = "asalHeadFk")
	@Caption(value="asalHeadFk")
	private Asal asalHead;

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

	@ManyToOne
	@JoinColumn(name = "asalAsalFk")
	@Caption(value="asalAsalFk")
	private Asal asalAsal;

	@Column(name = "asalAsalFk", insertable=false,updatable=false,nullable=false)
	private Integer asalAsalId;

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

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

	@Column(name = "qAsal", nullable = false)
	@Caption(value = "qAsal")
	private Byte qAsal;

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

	public Integer getId() {
		return id;
	}

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