我在Spring Repository中使用了下面的方法,同时执行的异常是“位置为2的参数不存在”。我尝试了不同的选项来转义单引号(‘),希望问题只存在于此。请提个建议。
@Query(value="select cus_acc_grp_i,"
            + " xmlquery ('$APP_CMP_WRK_XML/Root/CCPABusRuleAscList/CCPABusRuleAsc[position() >= (?2) and not(position() > (?3)) ]')"
            + " from ADM_APP_CMP_WRK  where CUS_ACC_GRP_I = (?1)", nativeQuery=true)
    AdministrationApplicationCompletion findCurrentPageRulesByClient(@Param("clientId") Integer customerAccountGroupId, 
            @Param("startIndex") Integer startIndex,
            @Param("endIndex") Integer endIndex);发布于 2016-05-17 15:35:46
@Smitha
你可以试试下面的方法:
@Query(value="select cus_acc_grp_i,"
            + " xmlquery ('$APP_CMP_WRK_XML/Root/CCPABusRuleAscList/CCPABusRuleAsc[position() >= (:startIndex) and not(position() > (:endIndex)) ]')"
            + " from ADM_APP_CMP_WRK  where CUS_ACC_GRP_I = (:customerAccountGroupId)", nativeQuery=true)
    AdministrationApplicationCompletion findCurrentPageRulesByClient(@Param("clientId") Integer customerAccountGroupId, 
            @Param("startIndex") Integer startIndex,
        @Param("endIndex") Integer endIndex);请让我知道这是否有效:)
https://stackoverflow.com/questions/37245968
复制相似问题