getting error : Operand should contain 1 column(s). without having inner query on jpa spcification generated query

getting error : Operand should contain 1 column(s). without having inner query on jpa spcification generated query

我收到错误:操作数应包含 1 列 在 jpa 规范生成的查询上,在该查询上没有子查询,仅基于其创建的连接。 下面是代码演示:

select 
    count(studentcla0_.STUDENT_CLASS_SECTION_MAPPING_ID) as col_0_0_ 
from 
    STUDENT_CLASS_SECTION_MAPPING studentcla0_ inner join STUDENT studentdo1_ 
    on studentcla0_.STUDENT=studentdo1_.STUDENT_ID inner join STUDENT studentdo2_ 
    on studentcla0_.STUDENT=studentdo2_.STUDENT_ID cross join USER_CREDENTIALS usercreden3_ 
    cross join USER_CREDENTIALS usercreden4_ 
where 
    studentdo2_.FATHER_CREDENTIAL=usercreden3_.USER_CREDENTIAL_ID 
    and studentdo1_.FATHER_CREDENTIAL=usercreden4_.USER_CREDENTIAL_ID 
    and 
        (usercreden3_.SCHOOL=? 
        and studentcla0_.CLASS=? 
        and studentcla0_.ACADEMIC_YEAR=? 
        and studentcla0_.STUDENT<>
            (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) 
        or usercreden4_.SCHOOL=? 
        and studentcla0_.CLASS=? 
        and studentcla0_.ACADEMIC_YEAR=? 
        and studentcla0_.TC_ALLOTED<>? 
        and studentdo1_.STUDENT_STATUS<>? 
        and studentcla0_.STUDENT<>?) 
group by studentcla0_.STUDENT_CLASS_SECTION_MAPPING_ID;

我整天都被困在这个问题上,请有人帮助我。

您不能在不等于 (<>) 中添加多个值,请改用 not in

studentcla0_.STUDENT<> (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) 

必须是

studentcla0_.STUDENT NOT IN (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?)