128 lines
3.6 KiB
Java
128 lines
3.6 KiB
Java
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.JsonIgnoreProperties;
|
|
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 Propinsi
|
|
*
|
|
* @author Generator
|
|
*/
|
|
@Entity // @Audited
|
|
@Table(name = "Propinsi_M")
|
|
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
|
|
public class Propinsi extends BaseMaster {
|
|
@NotNull(message = "Kd Propinsi tidak boleh kosong")
|
|
@Column(name = "KdPropinsi", nullable = false)
|
|
@Caption(value = "Kode Propinsi")
|
|
private Byte kdPropinsi;
|
|
|
|
public void setKdPropinsi(Byte kdPropinsi) {
|
|
this.kdPropinsi = kdPropinsi;
|
|
}
|
|
|
|
public Byte getKdPropinsi() {
|
|
return this.kdPropinsi;
|
|
}
|
|
|
|
@NotNull(message = "Nama Propinsi tidak boleh kosong")
|
|
@Column(name = "NamaPropinsi", nullable = false, length = 50)
|
|
@Caption(value = "Nama Propinsi")
|
|
private String namaPropinsi;
|
|
|
|
public void setNamaPropinsi(String namaPropinsi) {
|
|
this.namaPropinsi = namaPropinsi;
|
|
}
|
|
|
|
public String getNamaPropinsi() {
|
|
return this.namaPropinsi;
|
|
}
|
|
|
|
@NotNull(message = "QPropinsi tidak boleh kosong")
|
|
@Column(name = "QPropinsi", nullable = false)
|
|
@Caption(value = "QPropinsi")
|
|
private Byte qPropinsi;
|
|
|
|
public void setqPropinsi(Byte qPropinsi) {
|
|
this.qPropinsi = qPropinsi;
|
|
}
|
|
|
|
public Byte getqPropinsi() {
|
|
return this.qPropinsi;
|
|
}
|
|
|
|
/*
|
|
* @JsonManagedReference
|
|
*
|
|
* @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
|
|
* mappedBy="kdpropinsi") private Set<Alamat> AlamatSet = new
|
|
* HashSet<Alamat>();
|
|
*
|
|
* public Set<Alamat> getAlamatSet() { return AlamatSet; }
|
|
*
|
|
* public void setAlamatSet(Set<Alamat> alamatSet) { AlamatSet = alamatSet;
|
|
* }
|
|
*
|
|
* @JsonManagedReference
|
|
*
|
|
* @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
|
|
* "kdpropinsi") private Set<DesaKelurahan> DesaKelurahanSet = new
|
|
* HashSet<DesaKelurahan>();
|
|
*
|
|
* public Set<DesaKelurahan> getDesaKelurahanSet() { return
|
|
* DesaKelurahanSet; }
|
|
*
|
|
* public void setDesaKelurahanSet(Set<DesaKelurahan> desaKelurahanSet) {
|
|
* DesaKelurahanSet = desaKelurahanSet; }
|
|
*
|
|
* @JsonManagedReference
|
|
*
|
|
* @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
|
|
* "kdpropinsi") private Set<Kecamatan> KecamatanSet = new
|
|
* HashSet<Kecamatan>();
|
|
*
|
|
* public Set<Kecamatan> getKecamatanSet() { return KecamatanSet; }
|
|
*
|
|
* public void setKecamatanSet(Set<Kecamatan> kecamatanSet) { KecamatanSet =
|
|
* kecamatanSet; }
|
|
*/
|
|
|
|
@JsonManagedReference
|
|
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "propinsi")
|
|
private Set<KotaKabupaten> kotaKabupaten = new HashSet<KotaKabupaten>();
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.propinsi_m_id_seq")
|
|
@javax.persistence.SequenceGenerator(name = "public.propinsi_m_id_seq", sequenceName = "public.propinsi_m_id_seq", allocationSize = 1)
|
|
@Column(name = "id")
|
|
protected Integer id;
|
|
|
|
public Integer getId() {
|
|
|
|
return id;
|
|
}
|
|
|
|
public void setId(Integer id) {
|
|
this.id = id;
|
|
}
|
|
} |