updated code
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "additional_info_bill_validate")
|
||||
@Getter
|
||||
@Setter
|
||||
public class AdditionalInfoBillValidate {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
private String value;
|
||||
// ✅ Many Params → One Bill
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "bill_id_fk")
|
||||
private BillValidation bill;
|
||||
|
||||
}
|
||||
@@ -37,8 +37,8 @@ public class BillValidation {
|
||||
@Column(name = "biller_response", columnDefinition = "TEXT")
|
||||
private String billerResponse;
|
||||
|
||||
@Column(name = "additional_info", columnDefinition = "TEXT")
|
||||
private String additionalInfo;
|
||||
@OneToMany(mappedBy = "bill", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<AdditionalInfoBillValidate> additionalInfo;
|
||||
|
||||
// 👇 Proper nested customer params (OneToMany)
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bill")
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@Table(name = "biller_additional_info_payment")
|
||||
@Entity
|
||||
public class BillerAdditionalInfoPayment {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id; // primary key for the table
|
||||
|
||||
@Column(name = "param_config_id", nullable = false)
|
||||
@NotBlank(message = "Param Config ID cannot be blank")
|
||||
private String paramConfigId;
|
||||
|
||||
@Column(name = "param_name", nullable = false)
|
||||
@NotBlank(message = "Param name cannot be blank")
|
||||
private String paramName;
|
||||
|
||||
@Column(name = "data_type_dao")
|
||||
private String dataTypeDAO;
|
||||
|
||||
@Column(name = "data_type_model")
|
||||
private String dataTypeModel;
|
||||
|
||||
@Column(name = "optional", nullable = false)
|
||||
private boolean optional;
|
||||
|
||||
@Column(name = "visibility", nullable = false)
|
||||
private boolean visibility;
|
||||
|
||||
// 🔗 Many AdditionalInfos belong to one Biller
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "biller_id", nullable = false)
|
||||
private BillerDetails biller;
|
||||
}
|
||||
@@ -29,7 +29,8 @@ import lombok.ToString;
|
||||
"billerAdditionalInfos",
|
||||
"interchangeFeeConves",
|
||||
"interchangeFees",
|
||||
"billerPlanResponseParams"
|
||||
"billerPlanResponseParams",
|
||||
"billerAdditionalInfoPayments"
|
||||
})
|
||||
|
||||
@Table(name = "biller_details")
|
||||
@@ -151,11 +152,9 @@ public class BillerDetails {
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<AdditionalInfo> billerAdditionalInfos;
|
||||
|
||||
|
||||
/*
|
||||
* OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval
|
||||
* =true) private List<AdditionalInfo> billerAdditionalInfoPayments;
|
||||
*/
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval=true)
|
||||
private List<BillerAdditionalInfoPayment> billerAdditionalInfoPayments;
|
||||
|
||||
|
||||
@OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<InterchangeFeeConf> interchangeFeeConves;
|
||||
|
||||
Reference in New Issue
Block a user