Reputation: 489
I'm using spring-data-neo4j 3.1.1.Release with neo4j 2.1.2. I managed to make a spring configuration which is working well but it use the org.neo4j.kernel.EmbeddedGraphDatabase class which is now deprecated. Here is my current configuration :
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase"
destroy-method="shutdown">
<constructor-arg index="0" value="${graphdir}"/>
<!-- optionally pass in neo4j-config parameters to the graph database -->
<constructor-arg index="1">
<map>
<entry key="allow_store_upgrade" value="true"/>
</map>
</constructor-arg>
<constructor-arg index="2" ref="defaultGraphDatabaseDependencies" />
</bean>
<bean id="defaultGraphDatabaseDependencies" class="org.neo4j.kernel.DefaultGraphDatabaseDependencies"/>
<neo4j:config graphDatabaseService="graphDatabaseService" base-package="com.company.domain"/>
How can I write the same kind of spring configuration but using non deprecated classes please ?
Upvotes: 2
Views: 1433
Reputation: 39905
You can use the GraphDatabaseFactory class using spring for this. I've blogged about at http://blog.armbruster-it.de/2013/08/configuring-a-neo4j-graphdatabaseservice-via-spring/
Upvotes: 5