Create model entities
Pembuatan table dpjp pasien dan dokter rawat bersama
This commit is contained in:
parent
6cda637bd1
commit
386538d59b
@ -0,0 +1,34 @@
|
||||
package com.jasamedika.medifirst2000.entities;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author salmanoe
|
||||
* @version 1.0.0
|
||||
* @since 21/12/2023
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "dokterrawatbersama_t")
|
||||
public class DokterRawatBersama implements Serializable {
|
||||
private static final long serialVersionUID = -2730359617233536316L;
|
||||
|
||||
@EmbeddedId
|
||||
private DokterRawatBersamaId id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@NotNull(message = "Tanggal awal tidak boleh kosong")
|
||||
private Date tanggalAwal;
|
||||
|
||||
private Date tanggalAkhir;
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.jasamedika.medifirst2000.entities;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import static javax.persistence.FetchType.LAZY;
|
||||
|
||||
/**
|
||||
* @author salmanoe
|
||||
* @version 1.0.0
|
||||
* @since 21/12/2023
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Embeddable
|
||||
public class DokterRawatBersamaId implements Serializable {
|
||||
private static final long serialVersionUID = 6205499315933943133L;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "dpjppasienfk")
|
||||
@ToString.Exclude
|
||||
private DpjpPasien dpjpPasien;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "dokterfk")
|
||||
@ToString.Exclude
|
||||
private Pegawai dokter;
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.jasamedika.medifirst2000.entities;
|
||||
|
||||
import com.jasamedika.medifirst2000.base.BaseTransaction;
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import static javax.persistence.FetchType.LAZY;
|
||||
|
||||
/**
|
||||
* @author salmanoe
|
||||
* @version 1.0.0
|
||||
* @since 21/12/2023
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "dpjppasien_t")
|
||||
public class DpjpPasien extends BaseTransaction implements Serializable {
|
||||
private static final long serialVersionUID = 1837465073831420975L;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "dokterfk")
|
||||
@Caption(value = "Dokter")
|
||||
private Pegawai dokter;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "pasienfk")
|
||||
@Caption(value = "Pasien")
|
||||
private Pasien pasien;
|
||||
|
||||
@Column(nullable = false)
|
||||
@NotNull(message = "Tanggal awal tidak boleh kosong")
|
||||
private Date tanggalAwal;
|
||||
|
||||
private Date tanggalAkhir;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user