我有一个春季Neo4j服务器,我想为一些功能添加第二个SQL存储库,这些存储库将与Neo4j服务器分开使用。我认为我需要阅读两个DBconfig类,每个数据库一个。我是否有这样的配置文件:
关系:
@Configuration
//not sure this PropertySource is going to be right
//TODO: Create new property Source (HINT: Property file in resources)
@PropertySource({"classpath:persistence-multiple-db.properties"})
@EnableJpaRepositories(
basePackages = "com.saminahbab.springneoserver.model.relational",
entityManagerFactoryRef = "CampaignEntityManager",
transactionManagerRef = "CampaignTransactionManager"
)
public class CampaignConfig { .....}
和neo4j数据库的另一个dbconfig文件:
@Configuration
@EnableNeo4jRepositories(basePackages = "org.neo4j.example.repository")
@EnableTransactionManagement
public class MyConfiguration {
@Bean
public SessionFactory sessionFactory() {
// with domain entity base package(s)
return new SessionFactory(configuration(), "org.neo4j.example.domain");
...... }
我的问题是,如何将每个配置链接到我的Neo4jRepository
和我的CrudRepository
这两个不同的存储库?