diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/Neo4jConfiguration.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/Neo4jConfiguration.java index 69608849d..674ce96a1 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/Neo4jConfiguration.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/config/Neo4jConfiguration.java @@ -60,6 +60,7 @@ import java.util.Arrays; import java.util.Set; import static java.util.Arrays.asList; +import javax.enterprise.inject.Produces; /** * Abstract base class for code based configuration of Spring managed Neo4j infrastructure. @@ -252,6 +253,7 @@ public abstract class Neo4jConfiguration { @Bean @Autowired @DependsOn("graphDatabaseService") + @Produces public GraphDatabase graphDatabase() { if (graphDatabaseService instanceof GraphDatabase) return (GraphDatabase) graphDatabaseService; return new DelegatingGraphDatabase(graphDatabaseService); diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/DelegatingGraphDatabase.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/DelegatingGraphDatabase.java index 8b1f6c814..a6167e062 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/DelegatingGraphDatabase.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/DelegatingGraphDatabase.java @@ -63,6 +63,9 @@ public class DelegatingGraphDatabase implements GraphDatabase { private ResultConverter resultConverter; private volatile CypherQueryEngineImpl cypherQueryEngine; + public DelegatingGraphDatabase() { + } + public DelegatingGraphDatabase(final GraphDatabaseService delegate) { this(delegate,null); } diff --git a/spring-data-neo4j/src/main/resources/META-INF/beans.xml b/spring-data-neo4j/src/main/resources/META-INF/beans.xml new file mode 100644 index 000000000..4ca8195be --- /dev/null +++ b/spring-data-neo4j/src/main/resources/META-INF/beans.xml @@ -0,0 +1,5 @@ + + +