Java 使用Postrges时Spring JPA查询中的嵌套选择
在SpringJPA存储库中,我有以下方法Java 使用Postrges时Spring JPA查询中的嵌套选择,java,spring,postgresql,jpa,Java,Spring,Postgresql,Jpa,在SpringJPA存储库中,我有以下方法 @Query("select e from Entity e where e.enabled = true and e.id in :ids and (select count(*) from SubEntity se where se.e = e and se.date = :date) = 0") public Page<Entity> query(@Param("date") String date, @Param("ids"
@Query("select e from Entity e where e.enabled = true and e.id in :ids and (select count(*) from SubEntity se where se.e = e and se.date = :date) = 0")
public Page<Entity> query(@Param("date") String date, @Param("ids") List<Long> ids, Pageable pageable);
原因可能是什么?尝试记录实际的SQL运行,以便查看SQL无效的原因。感谢您的建议,传递的ID列表为空。
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
Position: 123