InstitutionListOfWhomHelp

InstitutionListOfWhomHelp

我使用Spring数据对MySql数据库进行选择操作。
我正试图通过listOfWhomHelp获得所有机构。
我期望所有包含institutions的记录(listOfWhomHelp),但是如果我在listOfWhomHelp中选择了多个元素,它会抛出我:

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

存储库方法
List<Institution> findAllByWhomHelp(List<InstitutionListOfWhomHelp> institutionListOfWhomHelp);

服务方式
public List<Institution> findInstitutions(Institution institution) throws NullPointerException {

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

也有InstitutionLocation的列表,但我总是从中选择
机构
@NotEmpty
@ManyToMany
private List<InstitutionListOfWhomHelp> whomHelp;

医疗帮助机构列表
@NotBlank
private String whomHelp;

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

最佳答案

你能试一下吗

instituonRepository.findAllByWhomHelpIn

谢谢

08-27 11:41