找不到Spring MVC Neo4jConfiguration类 [英] Spring MVC Neo4jConfiguration class not found
问题描述
我正在学习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.
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屋!