Last active
December 19, 2015 22:39
-
-
Save sarmbruster/6028963 to your computer and use it in GitHub Desktop.
Spring bean definition in XML to create a Neo4j GraphDatabaseService using the GraphDatabaseFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:util="http://www.springframework.org/schema/util" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> | |
<util:map id="config"> | |
<entry key="enable_remote_shell" value="true"/> | |
</util:map> | |
<bean id="graphDbFactory" class="org.neo4j.graphdb.factory.GraphDatabaseFactory"/> | |
<bean id="graphDbBuilder" factory-bean="graphDbFactory" factory-method="newEmbeddedDatabaseBuilder"> | |
<constructor-arg value="/tmp/neo4j"/> | |
</bean> | |
<bean id="graphDbBuilderFinal" factory-bean="graphDbBuilder" factory-method="setConfig"> | |
<constructor-arg ref="config"/> | |
</bean> | |
<bean id="graphDatabaseService" factory-bean="graphDbBuilderFinal" factory-method="newGraphDatabase" destroy-method="shutdown" /> | |
</beans> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment