package com.jasamedika.medifirst2000.entities; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.jasamedika.medifirst2000.base.BaseMaster; import com.jasamedika.medifirst2000.helper.Caption; import lombok.Getter; import lombok.Setter; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import javax.persistence.*; import javax.validation.constraints.NotNull; import static javax.persistence.FetchType.LAZY; /** * class DesaKelurahan * * @author Generator */ @Getter @Setter @Entity @Table(name = "DesaKelurahan_M") @JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" }) public class DesaKelurahan extends BaseMaster { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.desakelurahan_m_id_seq") @SequenceGenerator(name = "public.desakelurahan_m_id_seq", sequenceName = "public.desakelurahan_m_id_seq", allocationSize = 1) @Column(name = "id") protected Integer id; @NotNull(message = "Kd Desa Kelurahan tidak boleh kosong") @Column(name = "KdDesaKelurahan", nullable = false) @Caption(value = "Kode Desa Kelurahan") private Integer kdDesaKelurahan; @ManyToOne(fetch = LAZY) @Fetch(FetchMode.JOIN) @JoinColumn(name = "ObjectKecamatanFk") @NotNull(message = "Kd Kecamatan tidak boleh kosong") @Caption(value = "Object Kecamatan") private Kecamatan kecamatan; @Column(name = "ObjectKecamatanFk", insertable = false, updatable = false) private Integer kecamatanId; @ManyToOne(fetch = LAZY) @JoinColumn(name = "ObjectKotaKabupatenFk") @NotNull(message = "Kd Kota Kabupaten tidak boleh kosong") @Caption(value = "Object Kota Kabupaten") private KotaKabupaten kotaKabupaten; @Column(name = "ObjectKotaKabupatenFk", insertable = false, updatable = false, nullable = false) private Integer kotaKabupatenId; @ManyToOne(fetch = LAZY) @JoinColumn(name = "ObjectPropinsiFk") @NotNull(message = "Kd Propinsi tidak boleh kosong") @Caption(value = "Object Propinsi") private Propinsi propinsi; @Column(name = "ObjectPropinsiFk", insertable = false, updatable = false, nullable = false) private Integer propinsiId; @Column(name = "KodePos", length = 10) @Caption(value = "Kode Pos") private String kodePos; @NotNull(message = "Nama Desa Kelurahan tidak boleh kosong") @Column(name = "NamaDesaKelurahan", nullable = false, length = 50) @Caption(value = "Nama Desa Kelurahan") private String namaDesaKelurahan; @NotNull(message = "QDesa Kelurahan tidak boleh kosong") @Column(name = "QDesaKelurahan", nullable = false) @Caption(value = "QDesa Kelurahan") private Integer qDesaKelurahan; @ManyToOne(fetch = LAZY) @JoinColumn(name = "migrasikelurahandesafk") @Caption(value = "Migrasi Kelurahan Desa") private MigrasiKelurahanDesa migrasiKelurahanDesa; @Column(name = "migrasikelurahandesafk", insertable = false, updatable = false) private Long migrasiKelurahanDesaId; }