gpt4 book ai didi

java - org.hibernate.QueryException : could not resolve property --problem

转载 作者:行者123 更新时间:2023-12-01 23:14:01 26 4
gpt4 key购买 nike

当我尝试在 Eclipse 中运行代码时收到此错误。

org.hibernate.QueryException: could not resolve property: card_id of: om.gov.moh.dto.TreatmentMemberDTO

我尝试了不同的解决方案。他们都没有帮助解决问题

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "MEMBERS_ID")
private Long members_id;

@Column(name = "FIRST_NAME")
private String first_name;


@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.EAGER)
@JoinColumn(name = "CARD_ID")
//@JsonIgnore //for ignore duplicate issue
@JsonBackReference
private TreatmentDueDTO treatment = new TreatmentDueDTO();

public TreatmentMemberDTO() {
super();
}

public TreatmentMemberDTO(Long members_id, String first_name, String second_name, LocalDate dob) {
super();
this.members_id = members_id;
this.first_name = first_name;
this.second_name = second_name;
this.dob = dob;

}

public Long getMembers_id() {
return members_id;
}

public void setMembers_id(Long members_id) {
this.members_id = members_id;
}

public String getFirst_name() {
return first_name;
}

public void setFirst_name(String first_name) {
this.first_name = first_name;

public TreatmentDueDTO getTreatment() {
return treatment;
}

public void setTreatment(TreatmentDueDTO treatment) {
this.treatment = treatment;
}

}

问题出在“card_id”连接列中。我该如何解决这个问题?

最佳答案

在TreatmentMemberDTO类中添加card_id字段/属性会对您有所帮助

关于java - org.hibernate.QueryException : could not resolve property --problem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58362138/

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