Spring MVC Neo4jConfiguration class not found

左心房为你撑大大i 提交于 2019-12-20 06:31:14

问题


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> 

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!


回答1:


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());
    }
}


来源:https://stackoverflow.com/questions/44888741/spring-mvc-neo4jconfiguration-class-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!