将WrappingNeoServerBootstrapper与spring-data-neo4j一起使用 [英] use WrappingNeoServerBootstrapper with spring-data-neo4j

查看:95
本文介绍了将WrappingNeoServerBootstrapper与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和嵌入式db(在spring上下文中为<neo4j:config storeDirectory="target/graph.db"/>),并希望使用webadmin和rest-interface.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆