gpt4 book ai didi

在Spring Boot中配置Neo4j

转载 作者:知者 更新时间:2024-03-12 12:33:36 25 4
gpt4 key购买 nike

Neo4j 是一个开源的 NoSQL 原生图形数据库,可为您的应用程序提供符合 ACID 的 tx 后端。在这个简短的教程中,我们将学习如何在Spring Boot中配置它.

为了使用 Neo4j 和 Spring Boot 为 Web 应用程序创建模板,您可以按如下方式引导您的项目:

$ spring init -dweb,data-neo4j -artifactId data-neo4j-demo

接下来,在 application**.properties** 中添加 Neo4j 的配置,如下例所示:

spring.data.neo4j.uri=http://server:7474 spring.data.neo4j.username=neo4j spring.data.neo4j.password=admin

接下来,您需要设计您的 Repository 类,使其扩展 org.springframework.data.neo4j.repository.GraphRepository

import org.springframework.data.neo4j.repository.GraphRepository;   public interface CustomerRepository extends GraphRepository<Customer> { ... }

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com