Create model entities
Review tabel mapping obat tindakan dan obat pelayanan pasien untuk amprah obat tindakan paket
This commit is contained in:
parent
7e796f8626
commit
683e5a0eb4
@ -1,16 +1,11 @@
|
||||
package com.jasamedika.medifirst2000.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Base class for all entities, but using String idString as 'id'
|
||||
*
|
||||
@ -19,20 +14,9 @@ import org.hibernate.validator.constraints.Length;
|
||||
@MappedSuperclass
|
||||
public class BaseMasterProduk extends BaseActive implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
// private static final long serialVersionUID = -7522287859244078391L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(
|
||||
strategy=GenerationType.SEQUENCE,
|
||||
generator="public.produk_m_id_seq")
|
||||
@javax.persistence.SequenceGenerator(
|
||||
name="public.produk_m_id_seq",
|
||||
sequenceName="public.produk_m_id_seq",
|
||||
allocationSize=1
|
||||
)
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.produk_m_id_seq")
|
||||
@SequenceGenerator(name = "public.produk_m_id_seq", sequenceName = "public.produk_m_id_seq", allocationSize = 1)
|
||||
@Column(name = "id")
|
||||
protected Integer id;
|
||||
|
||||
@ -57,10 +41,6 @@ public class BaseMasterProduk extends BaseActive implements Serializable {
|
||||
this.noRec = noRec;
|
||||
}
|
||||
|
||||
// public static long getSerialversionuid() {
|
||||
// return serialVersionUID;
|
||||
// }
|
||||
|
||||
@Length(min = 1, max = 50, message = "")
|
||||
@Column(name = "reportDisplay")
|
||||
protected String reportDisplay;
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
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 static javax.persistence.FetchType.LAZY;
|
||||
|
||||
/**
|
||||
* @author salmanoe
|
||||
* @version 1.0.0
|
||||
* @since 15/02/2024
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "obattindakan_t")
|
||||
public class ObatLayananTindakan extends BaseTransaction implements Serializable {
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "tindakanpasienfk", nullable = false)
|
||||
@NotNull(message = "Tindakan pasien Tidak boleh Kosong")
|
||||
@Caption(value = "Tindakan Pasien")
|
||||
private PelayananPasien tindakanPasien;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "obatfk", nullable = false)
|
||||
@NotNull(message = "Obat tidak boleh kosong")
|
||||
@Caption(value = "Obat")
|
||||
private Produk obat;
|
||||
|
||||
@Column(nullable = false, columnDefinition = "numeric(6,2)")
|
||||
@NotNull(message = "Jumlah obat tidak boleh kosong")
|
||||
private Double jumlahObat;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
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.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
import static javax.persistence.FetchType.LAZY;
|
||||
|
||||
/**
|
||||
* @author salmanoe
|
||||
* @version 1.0.0
|
||||
* @since 15/02/2024
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "obattindakan_m")
|
||||
public class ObatTindakan extends BaseTransaction implements Serializable {
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "tindakanfk", nullable = false)
|
||||
@NotNull
|
||||
@Caption(value = "Tindakan")
|
||||
private Produk tindakan;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "obatfk", nullable = false)
|
||||
@NotNull(message = "Obat tidak boleh kosong")
|
||||
@Caption(value = "Obat")
|
||||
private Produk obat;
|
||||
}
|
||||
@ -6,6 +6,7 @@ import com.jasamedika.medifirst2000.base.BaseMasterProduk;
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
@ -23,6 +24,7 @@ import static javax.persistence.FetchType.LAZY;
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@Table(name = "Produk_M")
|
||||
public class Produk extends BaseMasterProduk {
|
||||
public Produk(String kdProduk, String namaProduk, Integer id, SatuanStandar satuanStandar) {
|
||||
@ -70,10 +72,6 @@ public class Produk extends BaseMasterProduk {
|
||||
this.keterangan = keterangan;
|
||||
}
|
||||
|
||||
public Produk() {
|
||||
|
||||
}
|
||||
|
||||
@JsonBackReference
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = LAZY, mappedBy = "produk")
|
||||
private Set<ProdukDetailLaboratorium> produkDetail = new HashSet<>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user