cuốn sách gpt4 ai đã làm

java - sql 问题 - java.sql.SQLException : Operand should contain 1 column(s) (once

In lại Tác giả: Walker 123 更新时间:2023-11-29 02:39:41 hai mươi bốn 4
mua khóa gpt4 Nike

我正在使用 Spring Data 在 MySql 数据库上进行选择操作。

我正在尝试通过 listOfWhomHelp 获取所有机构。我期望包含 listOfWhomHelp 的所有记录(institutions),但是如果我在 listOfWhomHelp 中选择多个元素,它会抛出我:

java.sql.SQLException: Operand should contain 1 column(s)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)

存储库方法

List findAllByWhomHelp(List institutionListOfWhomHelp);

服务方式

public List findInstitutions(Institution institution) throws NullPointerException {

if(institution.getInstitutionLocations().isEmpty()){
return institutionRepository.findAllByWhomHelp(institution.getWhomHelp());
}
}

bên cạnh đó InstitutionLocation 列表,但我总是选择其中一个

机构

@NotEmpty
@ManyToMany
private List whomHelp;

InstitutionListOfWhomHelp

@NotBlank
private String whomHelp;

@ManyToMany(mappedBy = "whomHelp")
private List institution;

câu trả lời hay nhất

你能像底部一样尝试吗

instituonRepository.findAllByWhomHelpIn

Cảm ơn

关于java - sql 问题 - java.sql.SQLException : Operand should contain 1 column(s) (once,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55350088/

hai mươi bốn 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress