Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 通过在dto内传递dto在@Query中出错_Java_Sql_Spring Boot_Jpa_Backend - Fatal编程技术网

Java 通过在dto内传递dto在@Query中出错

Java 通过在dto内传递dto在@Query中出错,java,sql,spring-boot,jpa,backend,Java,Sql,Spring Boot,Jpa,Backend,我在下面的查询中遇到NoViableAltException,我正在dto中传递dto!如下 @Query("SELECT new com.i2p.ipsos.dto.AdDiagnosticDto(ad.Q1,new com.i2p.ipsos.dto.AdDiagnosticSelect(" + "sum(case when ad.Q1 = 'Agree Strongly' or ad.Q1 IS NULL then 1 else 0 end )

我在下面的查询中遇到NoViableAltException,我正在dto中传递dto!如下

@Query("SELECT new com.i2p.ipsos.dto.AdDiagnosticDto(ad.Q1,new com.i2p.ipsos.dto.AdDiagnosticSelect(" +
        "sum(case when ad.Q1 = 'Agree Strongly' or ad.Q1 IS NULL then 1 else 0 end )," +
        "sum(case when ad.Q1 = 'Agree Somewhat' or ad.Q1 IS NULL then 1 else 0 end )," +
        "sum(case when ad.Q1 = 'Disagree' or ad.Q1 IS NULL then 1 else 0 end )))" +
        "From AdDiagnostics  ad")
public List<AdDiagnosticSelect> getDiagnosticQ1();
@Query(“选择新建com.i2p.ipsos.dto.AdDiagnosticDto(ad.Q1,新建com.i2p.ipsos.dto.AdDiagnosticSelect(”+
求和(当ad.Q1='Agree Strongly'或ad.Q1为空时,则为1,否则为0结束)+
sum(当ad.Q1=‘稍微同意’或ad.Q1为空时,则为1,否则为0结束)+
“求和(当ad.Q1=‘不同意’或ad.Q1为空时,则为1,否则为0结束))”+
“来自不可知论者广告”)
公共列表getDiagnosticQ1();