neo4j - Configuring TypeRepresentationStrategy for EmbeddedGraphDatabase -


I can not configure TypeRepresentationStrategy because of the following reason:

Failed to convert value of type 'org.neo4j.kernel.EmbeddedGraphDatabase' to type 'org.springframework.data.neo4j.core.GraphDatabase';

I get Spring-Data-Neo4j 3.1.4 and Neo4j 2.1.2.

The reason for this is that the graphDatabaseService example I define in my spring-reference configuration is the type of , see my configuration:

  & lt; Util: map id = "config" & gt; & Lt; Entry key = "Remote_should_assusion" value = "true" /> & Lt; Entry key = "cache-type" value = "weak" /> & Lt; / Util: map & gt; & Lt; Bean id = "graphDbFactory" class = "org.neo4j.graphdb.factory.GraphDatabaseFactory" /> & Lt; Bean id = "GraphBiblebuilder" factory-bean = "graphfbffifter" factory-method = "new embedded database builder" & gt; & Lt; Constructor-arg value = "target / neo4j-db-plain" /> & Lt; / Bean & gt; & Lt; Bean id = "graphDbBuilderFinal" factory-ben = "graphDbBuilder" factory-method = "setConfig" & gt; & Lt; Constructor-arg referee = "config" /> & Lt; / Bean & gt; & Lt; Bean id = "graphDatabaseService" factory-bean = "graphDbBuilderFinal" factory-method = "newGraphDatabase" delete-method = "off" /> & Lt; Bean id = "serverWrapper" class = "org.neo4j.server.WrappingNeoServerBootstrapper" init-method = "start" delete-method = "stop" & gt; & Lt; Constructor-arg ref = "graphDatabaseService" / & gt; & Lt; / Bean & gt; & Lt; Neo4j: config base-package = "com.hobbydeed.graph.model" GrafDatabase service = "Graphdatabase service" /> & Lt; Bean id = "type repetition strategy factory" class = "org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory" & gt; & Lt; Constructor-RGI Index = "0" ref = "Graphed Services" /> & Lt; Constructor-Arg Type = "org.springframework.data.neo4j.support.typerepresentation.Type RepresentationTrategyFactory.Strategy" & gt; & Lt; Price & gt; Indexed & lt; / Pricing & gt; & Lt; / Creator-arg & gt; & Lt; / Bean & gt;  

The question is how can I configure TypeRepresentation from "indexed" when org.neo4j.kernel.EmbeddedGraphDatabase org.neo4j.graphdb.GraphDatabaseService , but TypeRepresentationFactory wants org.springframework.data.neo4j.core.GraphDatabase Code>?

Override with a chosen strategy node type autonomy autonomy

For the strategy factory that you have used, you can use the "graph debbase" bean reference.

Or you use the DelegatingGraphDatabase (graphDatabaseService) as the beacon for the graph database as default.


Comments