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.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 JenisAlamat
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisAlamat_M")
public class JenisAlamat extends BaseMaster {
	@NotNull(message = "Jenis Alamat tidak boleh kosong")
	@Column(name = "JenisAlamat", nullable = false, length = 30)
	@Caption(value = "Jenis Alamat")
	private String jenisAlamat;

	public void setJenisAlamat(String jenisAlamat) {
		this.jenisAlamat = jenisAlamat;
	}

	public String getJenisAlamat() {
		return this.jenisAlamat;
	}

	@NotNull(message = "Kd Jenis Alamat tidak boleh kosong")
	@Column(name = "KdJenisAlamat", nullable = false)
	@Caption(value = "Kode Jenis Alamat")
	private Byte kdJenisAlamat;

	public void setKdJenisAlamat(Byte kdJenisAlamat) {
		this.kdJenisAlamat = kdJenisAlamat;
	}

	public Byte getKdJenisAlamat() {
		return this.kdJenisAlamat;
	}

	@NotNull(message = "QJenis Alamat tidak boleh kosong")
	@Column(name = "QJenisAlamat", nullable = false)
	@Caption(value = "QJenis Alamat")
	private Byte qJenisAlamat;

	public void setqJenisAlamat(Byte qJenisAlamat) {
		this.qJenisAlamat = qJenisAlamat;
	}

	public Byte getqJenisAlamat() {
		return this.qJenisAlamat;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjenisalamat") private Set<Alamat> AlamatSet = new
	 * HashSet<Alamat>();
	 * 
	 * public Set<Alamat> getAlamatSet() { return AlamatSet; }
	 * 
	 * public void setAlamatSet(Set<Alamat> alamatSet) { AlamatSet = alamatSet;
	 * }
	 */

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

	public Integer getId() {

		return id;
	}

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