找不到 Spring MVC Neo4jConfiguration 类 [英] Spring MVC Neo4jConfiguration class not found

查看:26
本文介绍了找不到 Spring MVC Neo4jConfiguration 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 Spring MVC.我想扩展 Neo4jConfiguration 类,但它不可用.我导入了以下依赖项:

I am learning Spring MVC. I want to extend the Neo4jConfiguration class but it is not available. I imported the following dependency:

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-neo4j</artifactId>
    <version>4.2.4.RELEASE</version>
</dependency> 

之后,我从 maven 重新导入了库.据我所知,我现在应该能够扩展 Neo4jConfiguration 类.问题是什么?谢谢!

and after that I have reimported the libraries from maven. As I know I should now be able to extend the Neo4jConfiguration class. What is the problem? Thank you!

推荐答案

Neo4jConfiguration 已从 Spring Data Neo4j 4.2 中删除.

Neo4jConfiguration has been dropped from Spring Data Neo4j 4.2.

您可以参考升级到 Spring Data Neo4j 4.2 以便在没有它的情况下进行快速配置.

You can refer to the 'Configuring a Simple Spring Application' and 'Configuring Web Applications' in the Upgrading to Spring Data Neo4j 4.2 for a quick configuration without it.

他们提供的简单配置的代码示例是:

The code sample they provide for simple configuration is:

@Configuration
@EnableNeo4jRepositories(basePackages = "org.neo4j.example.repository")
@EnableTransactionManagement
public class MyNeo4jConfiguration {
    @Bean
    public SessionFactory sessionFactory() {
        // with domain entity base package(s)
        return new SessionFactory("org.neo4j.example.domain");
    }
    @Bean
    public Neo4jTransactionManager transactionManager() {
        return new Neo4jTransactionManager(sessionFactory());
    }
}

这篇关于找不到 Spring MVC Neo4jConfiguration 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆