- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Spring Data/Neo4j 和 REST API 开发一个 Web 应用程序。
我想知道我是否可以创建一种关系并以另一种关系结束,如下所示:
@RelationshipEntity(type = "HAS")
public class SpecialRelationship {
@StartNode
private NodeName node;
@EndNode
// @RelationshipEntity(type = "RELATED_TO") ... @RelationshipType
private RelationshipEntityName relationship;
private OtherProperty property;
}
是否可以有另一个关系(已经存在)作为 SpecialRelationship 的结束节点?我尝试添加注释(@RelationShipType...),但没有成功。
我已经在我的具体案例中尝试过这个。我试图保存一个 SpecialRelationship 但我有一个异常(exception):
AM org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [mvc-dispatcher] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: org.neo4j.kernel.impl.core.RelationshipProxy cannot be cast to org.neo4j.graphdb.Node] with root cause
java.lang.ClassCastException: org.neo4j.kernel.impl.core.RelationshipProxy cannot be cast to org.neo4j.graphdb.Node
at org.springframework.data.neo4j.support.mapping.EntityStateHandler.getOrCreateRelationship(EntityStateHandler.java:166)
at org.springframework.data.neo4j.support.mapping.EntityStateHandler.useOrCreateState(EntityStateHandler.java:139)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityConverterImpl.write(Neo4jEntityConverterImpl.java:163)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister$CachedConverter.write(Neo4jEntityPersister.java:179)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.persist(Neo4jEntityPersister.java:249)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.persist(Neo4jEntityPersister.java:231)
at org.springframework.data.neo4j.support.Neo4jTemplate.save(Neo4jTemplate.java:357)
at org.springframework.data.neo4j.support.Neo4jTemplate.save(Neo4jTemplate.java:351)
at org.springframework.data.neo4j.repository.AbstractGraphRepository.save(AbstractGraphRepository.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:358)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy102.save(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201)
at com.sun.proxy.$Proxy103.save(Unknown Source)
at com.zenika.zen.valueLevel.service.ValueLevelService.addSkillValueForUser(ValueLevelService.java:72)
at com.zenika.zen.valueLevel.service.ValueLevelService$$FastClassBySpringCGLIB$$fbb0d79e.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:711)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)
at com.zenika.zen.valueLevel.service.ValueLevelService$$EnhancerBySpringCGLIB$$2349f1df.addSkillValueForUser(<generated>)
at com.zenika.zen.valueLevel.controller.ValueLevelController.create(ValueLevelController.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:155)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.logging.log4j.core.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
预先感谢您的帮助。
最佳答案
不,您不能将关系直接连接到另一个关系。此限制来自 Neo4j 使用的属性图模型。
http://neo4j.com/developer/graph-database/#property-graph
如果您的模型与此类似:
(n1)-[r]->(n2)
并且您想要“连接”节点 x 和关系 r,您需要创建类似以下内容的内容:
(n1)-[r1]->(i)-[r2]->(n2)
(x)-[s]->(i)
哪里
关于java - Neo4j Spring 数据 : Is it possible to use Relationship Entity as End Node of other Relationship Entity?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28579783/
我有一个包含需要排序的不同项目的列表。但还有一个额外的问题:某些元素只允许出现在列表中的特定位置。 示例(请查看 http://jsfiddle.net/pYL32/2/ ):有一个包含元素 foo、
关于https://code.google.com/p/guava-libraries/wiki/UsingAndAvoidingNullExplained据解释,guava(以及后来的 java 8
我有一个名为 say CalculationOutcome 的类(class)和 FileHashOutcome .他们的构造函数有 (ActualResult, Throwable)参数,并在 Co
我正在使用pycharm,我的代码在分屏上。当我运行调试时,会弹出调试/运行窗口,它非常分散注意力并且限制了我在调试时可以查看的代码量......但我想保持它,因为我来回走动;另外,我想要调试变量的完
这个问题已经有答案了: 已关闭11 年前。 Possible Duplicate: javascript object, access variable property name? 我确信这是可以完
if (typeof Object.create !== 'function') { Object.create = function (o) { function F() {
在将实体存储在 redis 中作为序列化二进制 blob 的应用程序中工作。我有多个客户端处理同一个数据集,我希望使用乐观并发。 我的要求是: 在一次往返中读取特定键的序列化实体 将修改后的实体写回r
这个问题是指 C/x86 上使用的 IEEE 标准浮点数。 是否可以将任何数字(即不包括 NaN 之类的特殊值)浮点数或 double 数表示为十进制字符串,以便将该字符串转换回浮点数/ double
我的团队目前正在与 Lua 合作,创建一个 android 游戏。我们遇到的一件事是表面上无法创建重载构造函数。 我习惯于使用默认值设置一个对象,然后在需要时使其过载。 前任: apples() {
如何在 Scene Kit 中使用 SCNCamera 获得像鱼眼镜头那样的失真? 类似于这种图像的“鞠躬”: //正如 Rickster 指出的那样,这种失真被称为“桶形失真”。 从文档中,这是让我
我想问是否有一种方法可以多次评估 javascript 术语,而不需要一遍又一遍地解析一个术语。 说,您想要评估 var1/var2+Math.sqrt(var3) 每秒 20 次。 使用时这可能会出
我想知道在技术上是否可以在 java applet 中创建代理。 那么是否可以通过这个 java applet 代理路由所有进一步的浏览器请求? 例如,如果用户要浏览 google.com,默认行为是
我有以下代码,我想返回一个 bool 值或一个元组。 (函数 isvariable 和 dont_care 都返回 bool 值,仅供引用) let match_element (a, b) = if
这个问题困扰我很久了。我想要一个二叉树(或类似的嵌套结构)上的迭代器,它高效、简单且Pythonic。例如,对于这样的用法: for value in values(root): do_som
目前我有以下 MySQL 查询: SELECT COUNT(*) AS `count`, `v`.`value` FROM `client_entity_int` AS `v` INN
我正在使用 Angular 开发应用程序,客户端是 100% JS。我即将替换使用 ExtJS 制作的旧应用程序,但我不会更改服务器端。只有客户端从头开始重新编码。 我想在任何地方和任何机器上处理这个
有没有办法在运行时检索实例的声明类?例如: public class Caller { private JFrame frame = new JFrame("Test"); priva
我目前正在请求 MySQL 数据库使用 PDO 计算一些计数和总和。这个过程可能需要一段时间,如果用户突然想浏览另一个页面,他可能会停留在浏览器前面。 我试图弄清楚是否可以使用 PDO 启动 MySQ
想知道它是不是这样工作的: $result .= mysqli_query($query1); $result .= mysqli_query($query2); $result 会是查询 1 和 2
所以我有这样的挑战: body 背景上的图像,背景大小,覆盖以适合整个屏幕。在背景图像上是一些元素(建筑物)。所以我想将鼠标悬停在建筑物上,他们会更改颜色或添加阴影等。问题在于屏幕调整大小,当我调整屏
我是一名优秀的程序员,十分优秀!