package io.reflectoring.coderadar.graph.configuration;

import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;

@Configuration
@EnableNeo4jRepositories(basePackages = "io.reflectoring.coderadar.graph")
@EntityScan(basePackages = "io.reflectoring.coderadar.graph")
public class Neo4jConfiguration {}

package io.reflectoring.coderadar.graph.configuration;

import org.neo4j.ogm.session.SessionFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.data.neo4j.Neo4jProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;

@Configuration
@EnableNeo4jRepositories(basePackages = "io.reflectoring.coderadar.graph")
@EnableConfigurationProperties(value = Neo4jProperties.class)
public class Neo4jConfiguration {
    private final Neo4jProperties properties;

    public Neo4jConfiguration(Neo4jProperties properties) {
        this.properties = properties;
    }

    @Bean
    @ConditionalOnMissingBean
    public org.neo4j.ogm.config.Configuration configuration() {
        return this.properties.createConfiguration();
    }

    @Bean(name = "transactionManager")
    public PlatformTransactionManager transactionManager() {
        Neo4jTransactionManager txManager = new Neo4jTransactionManager();
        txManager.setSessionFactory(sessionFactory(configuration()));
        return txManager;
    }

    @Bean
    public SessionFactory sessionFactory(org.neo4j.ogm.config.Configuration configuration) {
        return new SessionFactory(configuration, "io.reflectoring.coderadar.core.projectadministration.domain", "io.reflectoring.coderadar.core.analyzer.domain");
    }
}

Extend the Neo4jConfiguration with configurations of beans