1

我在我的 Spring Boot 应用程序中使用 spring-data-aerospike 依赖项来与 Aerospike db 交互。我在使用 AerospikeRepository 的 findAll() 方法(与 CrudRepository 提供的 findAll() 方法同义)时遇到了以下错误。

java.lang.IllegalStateException:没有过滤器的查询将启动扫描。由于扫描是潜在的危险操作,因此默认情况下它们在 spring-data-aerospike 中被禁用。如果您仍需要使用它们,请通过scansEnabled.org.springframework.data.aerospike.config.AerospikeDataSettings

非常感谢任何线索或指针。

4

1 回答 1

1

为遇到相同问题的任何人留下答案。

这是我为解决问题所做的。

引用了org.springframework.data.aerospike.config.AerospikeDataSettings我的应用程序 Aerospike 配置类中的代码并覆盖了 bean

  *@Bean
  public AerospikeDataSettings aerospikeDataSettings() {
    return AerospikeDataSettings.builder().scansEnabled(true).sendKey(true).build();
  }*
于 2021-12-07T08:35:20.050 回答