引导Spring Data Neo4j存储库

lstz6jyr  于 2022-12-12  发布在  Spring
关注(0)|答案(1)|浏览(189)

我从Spring Data Neo4j开始,使用Spring Boot 3.0.0
创建了带有Spring Initializr的应用程序,添加了一个Node和一个Repository

Neo4j演示,Java

@SpringBootApplication
public class Neo4jDemo {

    public static void main(String[] args) {
        SpringApplication.run(Neo4jDemo.class, args);
    }

}

播放器.java

@Node("Player")
@RequiredArgsConstructor
public class Player {

    @Id
    private final String name;

}

播放器资源库.java

public interface PlayerRepository extends ReactiveNeo4jRepository<Player, String> {
}

当我运行这个程序时,它显示了两次Finished Spring Data repository scanning消息,存储库计数不同。

[           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Neo4j repositories in DEFAULT mode.
[           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 123 ms. Found 1 Neo4j repository interfaces.
[           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Neo4j repositories in DEFAULT mode.
[           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 2 ms. Found 0 Neo4j repository interfaces.

我错过了什么吗?
还是干脆忽略这些消息?
谢谢

gpfsuwkq

gpfsuwkq1#

将以下内容添加到application.properties后,它只显示Finished Spring Data repository scanning消息一次(具有正确的存储库计数)

应用程序.属性

.
.
.
spring.data.neo4j.repositories.type  = reactive

我想,早些时候它是在寻找两种(React式和命令式)类型的存储库。

相关问题