59 lines
1.8 KiB
Java
59 lines
1.8 KiB
Java
package com.jasamedika.medifirst2000.entities;
|
|
|
|
import com.jasamedika.medifirst2000.base.BaseMaster;
|
|
import com.jasamedika.medifirst2000.helper.Caption;
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
|
|
import javax.persistence.*;
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
import static javax.persistence.FetchType.LAZY;
|
|
import static javax.persistence.GenerationType.SEQUENCE;
|
|
|
|
@Getter
|
|
@Setter
|
|
@Entity
|
|
@Table(name = "Kecamatan_M")
|
|
public class Kecamatan extends BaseMaster {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = SEQUENCE, generator = "public.kecamatan_m_id_seq")
|
|
@SequenceGenerator(name = "public.kecamatan_m_id_seq", sequenceName = "public.kecamatan_m_id_seq", allocationSize = 1)
|
|
@Column(name = "id")
|
|
protected Integer id;
|
|
|
|
@NotNull(message = "Kd Kecamatan tidak boleh kosong")
|
|
@Column(name = "KdKecamatan", nullable = false)
|
|
@Caption(value = "Kode Kecamatan")
|
|
private Integer kdKecamatan;
|
|
|
|
@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)
|
|
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;
|
|
|
|
@NotNull(message = "Nama Kecamatan tidak boleh kosong")
|
|
@Column(name = "NamaKecamatan", nullable = false, length = 50)
|
|
@Caption(value = "Nama Kecamatan")
|
|
private String namaKecamatan;
|
|
|
|
@NotNull(message = "QKecamatan tidak boleh kosong")
|
|
@Column(name = "QKecamatan", nullable = false)
|
|
@Caption(value = "QKecamatan")
|
|
private Integer qKecamatan;
|
|
|
|
} |