Class AbstractNeo4jConfig

java.lang.Object
org.springframework.data.neo4j.config.AbstractNeo4jConfig

@Configuration @API(status=STABLE, since="6.0") public abstract class AbstractNeo4jConfig extends Object
Base class for imperative SDN configuration using JavaConfig. This can be included in all scenarios in which Spring Boot is not an option.
Since:
6.0
Author:
Michael J. Simons, Gerrit Meier
  • Constructor Details

    • AbstractNeo4jConfig

      public AbstractNeo4jConfig()
  • Method Details

    • neo4jConversions

      public Neo4jConversions neo4jConversions()
    • cypherDslConfiguration

      public org.neo4j.cypherdsl.core.renderer.Configuration cypherDslConfiguration()
    • neo4jMappingContext

      public Neo4jMappingContext neo4jMappingContext(Neo4jConversions neo4JConversions) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • driver

      public abstract org.neo4j.driver.Driver driver()
      The driver to be used for interacting with Neo4j.
      Returns:
      the Neo4j Java driver instance to work with.
    • neo4jClient

      @Bean("neo4jClient") public Neo4jClient neo4jClient(org.neo4j.driver.Driver driver, @Nullable DatabaseSelectionProvider databaseSelectionProvider)
      The driver used here should be the driver resulting from driver(), which is the default.
      Parameters:
      driver - the driver to connect with.
      databaseSelectionProvider - the database selection provider to use.
      Returns:
      a imperative Neo4j client.
    • neo4jTemplate

      @Bean("neo4jTemplate") public Neo4jOperations neo4jTemplate(Neo4jClient neo4jClient, Neo4jMappingContext mappingContext)
    • transactionManager

      @Bean("transactionManager") public PlatformTransactionManager transactionManager(org.neo4j.driver.Driver driver, @Nullable DatabaseSelectionProvider databaseSelectionProvider)
      Provides a PlatformTransactionManager for Neo4j based on the driver resulting from driver().
      Parameters:
      driver - the driver to synchronize against
      databaseSelectionProvider - the configured database selection provider
      Returns:
      a platform transaction manager
    • bookmarkManager

      @Bean public Neo4jBookmarkManager bookmarkManager()
    • databaseSelectionProvider

      @Bean protected DatabaseSelectionProvider databaseSelectionProvider()
      Configures the database selection provider.
      Returns:
      the default database name provider, defaulting to the default database on Neo4j 4.0 and on no default on Neo4j 3.5 and prior.
    • getMappingBasePackages

      protected Collection<String> getMappingBasePackages()
      Returns the base packages to scan for Neo4j mapped entities at startup. Will return the package name of the configuration class' (the concrete class, not this one here) by default. So if you have a com.acme.AppConfig extending Neo4jConfigurationSupport the base package will be considered com.acme unless the method is overridden to implement alternate behavior.
      Returns:
      the base packages to scan for mapped Node classes or an empty collection to not enable scanning for entities.
    • getInitialEntitySet

      protected final Set<Class<?>> getInitialEntitySet() throws ClassNotFoundException
      Scans the mapping base package for classes annotated with Node. By default, it scans for entities in all packages returned by getMappingBasePackages().
      Returns:
      initial set of domain classes
      Throws:
      ClassNotFoundException - if the given class cannot be found in the class path.
      See Also: