将 WrappingNeoServerBootstrapper 与 spring-data-neo4j 一起使用 [英] use WrappingNeoServerBootstrapper with spring-data-neo4j
问题描述
是否可以将 WrappingNeoServerBootstrapper
与 spring-data-neo4j 一起使用?
Is it possible to use the WrappingNeoServerBootstrapper
with spring-data-neo4j?
当使用没有 spring-data-neo4j 的嵌入式数据库时,可以使用 WrappingNeoServerBootstrapper
来启用 REST 接口和 Webadmin.我使用 spring-data-neo4j 和嵌入式数据库(<neo4j:config storeDirectory="target/graph.db"/>
在 spring 上下文中)并想使用 webadmin 和 rest-界面.
When using an embedded database without spring-data-neo4j, one can use a WrappingNeoServerBootstrapper
to enable the REST-interface and the Webadmin. I use spring-data-neo4j and an embedded db (<neo4j:config storeDirectory="target/graph.db"/>
in spring context) and would like to use the webadmin and rest-interface.
有没有办法做到这一点?
Is there any way to accomplish this?
我也想知道 spring-data-neo4j-rest 是否处理事务?
I am also wondering if spring-data-neo4j-rest handles transactions?
推荐答案
那应该没问题.下面的配置未经测试,但应该可以工作并让您了解如何设置它.
That should be no problem. The config below is not tested, but should work and give you an idea how to set it up.
<neo4j:config graphDatabaseService="gds"/>
<bean id="gds" class="...EmbeddedGraphDatabase">
<constructor-arg value="target/graph-db"/>
</bean>
<bean id="serverWrapper" class="...WrappingNeoServerBootstrapper" init-method="start" destroy-method="stop">
<constructor-arg ref="gds"/>
</bean>
事务的处理方式与 Neo4j-REST API 的处理方式相同.每个请求一个.底层的 neo4j-rest-graphdb 库也支持 REST-Batch API,但尚未在 SDN 中使用.
Transactions are handled the same way as the Neo4j-REST API does it. One per request. The underlying neo4j-rest-graphdb library also supports the REST-Batch API but that is not yet leveraged in SDN.
更新:
请将 webadmin 静态文件的依赖项添加到您的项目中,如下所示:
Please also add the dependency for the webadmin static files to your project, something like this:
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>1.5</version>
<type>jar</type>
<classifier>static-web</classifier>
</dependency>
这篇关于将 WrappingNeoServerBootstrapper 与 spring-data-neo4j 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!