Create model entities
Pembuatan table mapping KFA obat dan variasinya berdasarkan distributor
This commit is contained in:
parent
4cece06cb0
commit
0db7dad001
@ -0,0 +1,90 @@
|
||||
package com.jasamedika.medifirst2000.entities;
|
||||
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
import static javax.persistence.FetchType.LAZY;
|
||||
import static javax.persistence.GenerationType.SEQUENCE;
|
||||
|
||||
/**
|
||||
* @author salmanoe
|
||||
* @version 1.0.0
|
||||
* @since 09/01/2024
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "b_sh_map_kfa_toproduk")
|
||||
public class MapKfaToProduk implements Serializable {
|
||||
private static final long serialVersionUID = -3622226917866786718L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = SEQUENCE, generator = "gen_b_sh_map_kfa_toproduk_id_seq")
|
||||
@SequenceGenerator(name = "gen_b_sh_map_kfa_toproduk_id_seq", sequenceName = "public.b_sh_map_kfa_toproduk_sequence", allocationSize = 1)
|
||||
@Column(name = "id", columnDefinition = "int4 default nextval('b_sh_map_kfa_toproduk_sequence'::regclass)")
|
||||
protected Integer id;
|
||||
|
||||
@Column(name = "statusenabled", nullable = false)
|
||||
@NotNull(message = "Status tidak boleh kosong")
|
||||
@Caption("Status Enabled")
|
||||
private Boolean statusEnabled;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "id_smart", nullable = false)
|
||||
@NotNull(message = "Produk tidak boleh kosong")
|
||||
@Caption(value = "Produk")
|
||||
private Produk produk;
|
||||
|
||||
@Column(name = "id_smart", insertable = false, updatable = false)
|
||||
private Integer produkId;
|
||||
|
||||
@Column(name = "nama_produk", length = 500, nullable = false, unique = true)
|
||||
@Size(max = 500, message = "Nama produk maksimal {max} karakter")
|
||||
@NotBlank(message = "Nama produk tidak boleh kosong")
|
||||
@Caption("Nama Produk")
|
||||
private String namaProduk;
|
||||
|
||||
@Column(name = "satuan_dosis")
|
||||
@Caption("Satuan Dosis")
|
||||
private String satuanDosis;
|
||||
|
||||
@Column(name = "perkiraan_satuan_besar")
|
||||
@Caption("Perkiraan Satuan Besar")
|
||||
private String perkiraanSatuanBesar;
|
||||
|
||||
@Caption("Formula")
|
||||
private String formula;
|
||||
|
||||
@Column(name = "kode_kfa_1")
|
||||
@Caption("Kode KFA 1")
|
||||
private Integer kodeKfa1;
|
||||
|
||||
@Column(name = "nama_kfa_1", length = 500)
|
||||
@Size(max = 500, message = "Nama KFA 1 tidak boleh kosong")
|
||||
@Caption("Nama KFA 1")
|
||||
private String namaKfa1;
|
||||
|
||||
@Column(name = "kode_kfa_2")
|
||||
@Caption("Kode KFA 2")
|
||||
private Integer kodeKfa2;
|
||||
|
||||
@Column(name = "nama_kfa_2", length = 500)
|
||||
@Size(max = 500, message = "Nama KFA 2 tidak boleh kosong")
|
||||
@Caption("Nama KFA 2")
|
||||
private String namaKfa2;
|
||||
|
||||
@Column(name = "dosis_kfa_ingredients")
|
||||
@Caption("Dosis KFA Ingredients")
|
||||
private String dosisKfaIngredients;
|
||||
|
||||
@Column(name = "satuan_kfa_ingredients")
|
||||
@Caption("Satuan KFA Ingredients")
|
||||
private String satuanKfaIngredients;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.jasamedika.medifirst2000.entities;
|
||||
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
import static javax.persistence.FetchType.LAZY;
|
||||
import static javax.persistence.GenerationType.SEQUENCE;
|
||||
|
||||
/**
|
||||
* @author salmanoe
|
||||
* @version 1.0.0
|
||||
* @since 09/01/2024
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "b_sh_map_kfa_toproduk_varian")
|
||||
public class MapKfaToProdukVarian implements Serializable {
|
||||
private static final long serialVersionUID = 7946989249822624944L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = SEQUENCE, generator = "gen_b_sh_map_kfa_toproduk_varian_id_seq")
|
||||
@SequenceGenerator(name = "gen_b_sh_map_kfa_toproduk_varian_id_seq", sequenceName = "public.b_sh_map_kfa_toproduk_varian_sequence", allocationSize = 1)
|
||||
@Column(name = "id", columnDefinition = "int4 default nextval('b_sh_map_kfa_toproduk_varian_sequence'::regclass)")
|
||||
protected Integer id;
|
||||
|
||||
@Column(name = "statusenabled", nullable = false)
|
||||
@NotNull(message = "Status tidak boleh kosong")
|
||||
@Caption("Status Enabled")
|
||||
private Boolean statusEnabled;
|
||||
|
||||
@Column(name = "nama_varian", length = 500, nullable = false, unique = true)
|
||||
@Size(max = 500, message = "Nama varian maksimal {max} karakter")
|
||||
@NotBlank(message = "Nama varian tidak boleh kosong")
|
||||
@Caption("Nama Varian")
|
||||
private String namaVarian;
|
||||
|
||||
@Column(name = "kode_kfa_3")
|
||||
@Caption("Kode KFA 3")
|
||||
private Integer kodeKfa3;
|
||||
|
||||
@Column(name = "nama_kfa_3", length = 500)
|
||||
@Size(max = 500, message = "Nama KFA 3 tidak boleh kosong")
|
||||
private String namaKfa3;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "rekanan_id", nullable = false)
|
||||
@NotNull(message = "Rekanan distributor tidak boleh kosong")
|
||||
@Caption(value = "Rekanan distributor")
|
||||
private Rekanan distributor;
|
||||
|
||||
@Column(name = "rekanan_id", insertable = false, updatable = false)
|
||||
private Integer distributorId;
|
||||
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "b_sh_map_kfa_toproduk_id", nullable = false)
|
||||
@NotNull(message = "Mapping KFA tidak boleh kosong")
|
||||
@Caption(value = "Mapping KFA")
|
||||
private MapKfaToProduk mapKfaToProduk;
|
||||
|
||||
@Column(name = "b_sh_map_kfa_toproduk_id", insertable = false, updatable = false)
|
||||
private Integer mapKfaToProdukId;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user