RuntimeException
メソッドを呼び出すときに取得しNeo4jTemplate.getOrCreateRelationship()
、. を含むプロパティを渡しますArrayList
。
java.lang.RuntimeException: Error retrieving or creating relationship for key testKey and value 999 with index TestRelIndex
これが私のコードです:
Map<String, Object> relProperties = new HashMap<String, Object>();
List<String> tags = new ArrayList<String>();
tags.add("tag1");
tags.add("tag2");
relProperties.put("tags", tags);
Relationship rel = template.getOrCreateRelationship("TestRelIndex", "testKey", 999, userNode, itemNode, "shortlist", relProperties);
例外メッセージは説明的ではありません。いくつかのデバッグの後org.neo4j.rest.graphdb.ExecutingResAPI.getOrCreateRelationship()
、RuntimeException がスローされたメソッドから次のエラー メッセージを取得することができました。
{"message":"Unknown property type on: [tag1, tag2], class java.util.ArrayList","exception":"IllegalArgumentException","fullname":"java.lang.IllegalArgumentException","stacktrace":["org.neo4j.kernel.impl.nioneo.store.PropertyStore.encodeValue(PropertyStore.java:582)","org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relAddProperty(WriteTransaction.java:1210)","org.neo4j.kernel.impl.persistence.PersistenceManager.relAddProperty(PersistenceManager.java:176)","org.neo4j.kernel.impl.core.NodeManager.relAddProperty(NodeManager.java:1156)","org.neo4j.kernel.impl.core.RelationshipImpl.addProperty(RelationshipImpl.java:69)","org.neo4j.kernel.impl.core.Primitive.setProperty(Primitive.java:436)","org.neo4j.kernel.impl.core.RelationshipImpl.setProperty(RelationshipImpl.java:29)","org.neo4j.kernel.impl.core.RelationshipProxy.setProperty(RelationshipProxy.java:129)","org.neo4j.server.rest.web.DatabaseActions$UniqueRelationshipFactory.initialize(DatabaseActions.java:1058)","org.neo4j.server.rest.web.DatabaseActions$UniqueRelationshipFactory.initialize(DatabaseActions.java:1033)","org.neo4j.graphdb.index.UniqueFactory.getOrCreateWithOutcome(UniqueFactory.java:241)","org.neo4j.server.rest.web.DatabaseActions.getOrCreateIndexedRelationship(DatabaseActions.java:1018)","org.neo4j.server.rest.web.RestfulGraphDatabase.addToRelationshipIndex(RestfulGraphDatabase.java:871)","java.lang.reflect.Method.invoke(Method.java:601)","org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)"]}
と同じ関係を作成しようとしましたが、Neo4jTemplate.createRelationshipBetween()
うまく機能しています。Neo4jTemplate.getOrCreateRelationship()
配列型のプロパティはまだサポートしていないということですか?