How to configure neo4j and cassandra repositories in same spring boot application

后端 未结 2 405
鱼传尺愫
鱼传尺愫 2021-01-24 08:42

I have configured neo4j and cassandra repositories separately with spring boot using spring-data. However, when I try to use two repositories in the same projects it doesn\'t wo

2条回答
  •  野性不改
    2021-01-24 09:12

    I have used neo4j with mongo. I don't see any issues. I presume it should be same with cassandra. This is all the configuration I have

    @SpringBootApplication
    @EnableConfigurationProperties
    @EnableNeo4jRepositories("com.in.neo4j.repository.neo")
    @EnableMongoRepositories("com.in.neo4j.repository.mongo")
    public class Neo4JApplication {
        public static void main(String[] args) {
            SpringApplication.run(Neo4JApplication.class, args);
        }
    }
    

    And in my properties file I have

    spring.data.neo4j.username=neo4j  
    spring.data.neo4j.password=admin  
    
    spring.data.mongodb.database=blah  
    spring.data.mongodb.host=blahblah  
    spring.data.mongodb.port=27017
    

提交回复
热议问题