gpt4 book ai didi

java - org.hibernate.loader.MultipleBagFetchException : cannot simultaneously fetch multiple bags

转载 作者:太空宇宙 更新时间:2023-11-04 10:29:51 24 4
gpt4 key购买 nike

此错误不允许我访问 jsondoc,我已经尝试了此处提供的一些解决方案,但仍然遇到同样的问题。

我希望我已经足够清楚我想要你帮助我的事情。

我留下了错误以及错误中提到的类之一。

      Caused by: org.hibernate.loader.MultipleBagFetchException: cannot  
simultaneously fetch multiple bags:
[com.credix.sib.canales.applicant.Applicant.phoneApplicant,
com.credix.sib.canales.applicant.Applicant.addressApplicant]

添加了错误中显示的类之一

      @Entity
@Table(name="APL_APPLICANT", schema="CREDITAPPLICATION")
@NamedQuery(name="Applicant.findAll", query="SELECT a FROM Applicant a")
public class Applicant implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="APL_Id", insertable=false, updatable=false)
@ApiObjectField(description = "Id del Aplicante", required = true)
private Long id;

@Temporal(TemporalType.TIMESTAMP)
@Column(name="APL_CreateDate", updatable=false)
@ApiObjectField(description = "Fecha de creación del Aplicante", required = true)
private Date createDate;

@Column(name="APL_Email")
@ApiObjectField(description = "Email del Aplicante", required = true)
private String email;

@Column(name="APL_Identification", updatable=false)
@ApiObjectField(description = "Identificación del Aplicante", required = true)
private String identification;

@Temporal(TemporalType.TIMESTAMP)
@Column(name="APL_LastModifiedDate")
@ApiObjectField(description = "Fecha de la última modificación del Aplicante", required = true)
private Date lastModifiedDate;

@Column(name="APL_PrintName")
@ApiObjectField(description = "Nombre del Aplicante", required = true)
private String printName;

@OneToOne(fetch=FetchType.EAGER)
@JoinColumn(name="APS_Id")
@ApiObjectField(description = "Objeto Status del Aplicante", required = true)
private ApplicantStatus applicantStatus;

@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="IDT_Id")
@ApiObjectField(description = "Objeto tipo de identificación del Aplicante", required = true)
private IdentificationType identificationType;

@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="USU_IdCreate")
@ApiObjectField(description = "Objeto usuario creador del Aplicante")
private User userCreate;

@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="USU_IdLastModified", updatable = false)
@ApiObjectField(description = "Objeto usuario ultima modificación del Aplicante")
private User userLastModified;

@OneToOne(fetch=FetchType.EAGER)
@JoinColumn(name="APL_Id")
@ApiObjectField(description = "Objeto que contiene los datos personales del aplicante")
private PersonApplicant personApplicant;

@OneToMany(fetch=FetchType.EAGER)
@JoinColumn(name="APL_Id")
@ApiObjectField(description = "Lista de direcciones del aplicante")
private List<AddressApplicant> addressApplicant;

@OneToMany(fetch=FetchType.EAGER)
@JoinColumn(name="APL_Id")
@ApiObjectField(description = "Lista de números telefónicos del aplicante")
private List<PhoneApplicant> phoneApplicant;

@OneToMany(fetch=FetchType.LAZY)
@JoinColumn(name="APL_Id")
@ApiObjectField(description = "Lista de tipos de notificación del aplicante")
private List<PublicityNotification> publicityNotification;

@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="CTR_Id")
@ApiObjectField(description = "Objeto tipo de Pais", required = true)
private Country country;

public Applicant() {
}

public Long getId() {
return this.id;
}

public void setId(Long id) {
this.id = id;
}

public Date getCreateDate() {
return this.createDate;
}

public void setCreateDate(Date createDate) {
this.createDate = createDate;
}

public String getEmail() {
return this.email;
}

public void setEmail(String email) {
this.email = email;
}

public String getIdentification() {
return this.identification;
}

public void setIdentification(String identification) {
this.identification = identification;
}

public Date getLastModifiedDate() {
return this.lastModifiedDate;
}

public void setLastModifiedDate(Date lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}

public String getPrintName() {
return this.printName;
}

public void setPrintName(String printName) {
this.printName = printName;
}

public ApplicantStatus getApplicantStatus() {
return this.applicantStatus;
}

public void setApplicantStatus(ApplicantStatus applicantStatus) {
this.applicantStatus = applicantStatus;
}

public IdentificationType getIdentificationType() {
return this.identificationType;
}

public void setIdentificationType(IdentificationType identificationType) {
this.identificationType = identificationType;
}

public User getUserCreate() {
return this.userCreate;
}

public void setUserCreate(User userCreate) {
this.userCreate = userCreate;
}

public User getUserLastModified() {
return this.userLastModified;
}

public void setUserLastModified(User userLastModified) {
this.userLastModified = userLastModified;
}

public PersonApplicant getPersonApplicant() {
return this.personApplicant;
}

public void setPersonApplicant(PersonApplicant personApplicant) {
this.personApplicant = personApplicant;
}

public List<AddressApplicant> getAddressApplicant() {

ArrayList<AddressApplicant>();
return this.addressApplicant;
}

public void setAddressApplicant(List<AddressApplicant> addressApplicant) {
this.addressApplicant = addressApplicant;
}

public List<PhoneApplicant> getPhoneApplicant() {

ArrayList<PhoneApplicant>();

return this.phoneApplicant;
}

public void setPhoneApplicant(List<PhoneApplicant> phoneApplicant) {
this.phoneApplicant = phoneApplicant;
}

public List<PublicityNotification> getPublicityNotification() {

ArrayList<PublicityNotification>();
return this.publicityNotification;
}

public void setPublicityNotification(List<PublicityNotification>
publicityNotification) {
this.publicityNotification = publicityNotification;
}

/**
* @return the country
*/
public Country getCountry() {
return country;
}

/**
* @param country the country to set
*/
public void setCountry(Country country) {
this.country = country;
}

}

希望大家给点建议

最佳答案

正如消息所述:您无法同时提取多个行李

要解决该问题,您可以:

  1. 将用于 phoneApplicantaddressApplicant 的集合类型从 List 更改为 Set。此解决方案将导致集合没有顺序且没有重复项。如果您坚持要求订购可能存在重复项的集合,请使用下面描述的第二个选项。

  2. 使用注释 @OrderColumn 为两个列表提供订单列。

关于java - org.hibernate.loader.MultipleBagFetchException : cannot simultaneously fetch multiple bags,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50138385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com