Database Reference
In-Depth Information
Core XML configuration
You need to tell Spring what beans need to be created and instantiated. With the XML ap-
proach, this is done by providing an XML file with initial content that looks like the fol-
lowing.
Listing C.1. XML configuration using a store directory
TheNeo4j-specificXMLnamespaceelement,
neo4j:config
,providesasimplewayof
concisely configuring SDN. It creates or exposes the core graph database bean as well as
other helper classes, such as the
Neo4jTemplate
.
The
neo4j:config
element itself has four attributes (
storeDirectory
,
graph-
DatabaseService
,
entityManagerFactory
, and
typeRepresenta-
tionStrategyFactory
) that can be configured. For convenience, there is a
storeDirectory
attribute that when set points to a particular directory where a new
EmbeddedGraphDatabase
will be created if one doesn't exist (if one is already there,
it will be used). This is the approach used in the sample code.