Merge pull request #185 from remigio/patch-4

Patch 4
This commit is contained in:
Michael Hunger
2014-05-28 00:36:21 +02:00
3 changed files with 10 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>