50 lines
1.5 KiB
Java
50 lines
1.5 KiB
Java
package com.billpaymentservice.bbps.entites;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import jakarta.persistence.CascadeType;
|
|
import jakarta.persistence.CollectionTable;
|
|
import jakarta.persistence.Column;
|
|
import jakarta.persistence.ElementCollection;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.Id;
|
|
import jakarta.persistence.JoinColumn;
|
|
import jakarta.persistence.OneToMany;
|
|
import jakarta.persistence.OneToOne;
|
|
import jakarta.persistence.Table;
|
|
import jakarta.validation.constraints.NotBlank;
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
|
|
@Getter
|
|
@Setter
|
|
@Entity
|
|
@Table(name = "bbps_biller_response_params")
|
|
public class BillerResponseParams {
|
|
|
|
@Id
|
|
@Column(name = "biller_response_id", nullable = false, unique = true)
|
|
@NotBlank(message = "Biller Response ID is required")
|
|
private String billerResponseId;
|
|
|
|
// 🔗 One-to-One Relationship with BillerDAO
|
|
@OneToOne
|
|
@JoinColumn(name = "biller_id", nullable = false)
|
|
private BillerDetails biller;
|
|
|
|
// ✅ Since params and amountOptions are lists of objects,
|
|
// we can store them as JSON or in a separate table (simplified here using @ElementCollection)
|
|
|
|
@ElementCollection
|
|
@CollectionTable(
|
|
name = "biller_response_params_data",
|
|
joinColumns = @JoinColumn(name = "biller_response_id")
|
|
)
|
|
@Column(name = "param_value")
|
|
private List<String> params;
|
|
|
|
@OneToMany(mappedBy = "billerResponseParams", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
private List<AmountOption> amountOptions;
|
|
}
|