歡迎在同一條船上,也只是從Neo4j和SDN開始。你得到的錯誤是由於沒有聲明xmlns:neo4j,但你可能有其他一些問題,所以包括下面的整個文件。我的倉庫,註釋的bean等都在com.purr.justtravel.neo4j的子包中。
我沒有使用Spring數據本身的例子,而是根據這些例子做我自己的東西,但下面的配置適合我。
您可以在內存數據庫和進程內(但使用磁盤存儲)版本之間切換。內存數據庫只是用新的TestGraphDatabaseFactory()。newImpermanentDatabase()創建的,我用一個靜態工廠方法封裝了它。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/data/neo4j http://www.springframework.org/schema/data/neo4j/spring-neo4j.xsd">
<context:annotation-config />
<tx:annotation-driven mode="proxy" />
<!-- SAME PROCESS DATABASE -->
<neo4j:config storeDirectory="neo4jdb/store/graph.db" base-package="com.purr.justtravel.neo4j"/>
<!-- IN MEMORY DATABASE -->
<!-- <neo4j:config graphDatabaseService="graphDatabaseService" base-package="com.purr.justtravel.neo4j" /> -->
<!-- <bean id="graphDatabaseService" class="com.purr.justtravel.server.AbstractInMemoryNeo4jTest" factory-method="createNeo4jDatabase" /> -->
<neo4j:repositories base-package="com.purr.justtravel.neo4j" />
</beans>
我投了這個問題。我認爲春天人們爲增加sdn4j的採用所能做的最大的事情就是提供可用於開箱即用的更新文檔的示例,例如良好關係書的更新版本。我注意到,雖然本書頂部的版本號已經在版本中更新,但本書的內容並沒有使實際內容過時,與文檔化的目標版本號和誤導性不兼容。 –