3.3.0.M1 : Properties on RelationShipEntity not saved when using CypherRestGraphDatabase?

岁酱吖の 提交于 2019-12-12 03:22:09

问题


I've run into a snag with 3.3.0.M1 - I was much thrilled with the speed increase for the REST remoting, but it seems the relation properties aren't saved properly to the remote DB?

BTW; this worked "as advertised" in 3.2.1.RELEASE :-/

I've got a JUnit test that works beautifully using an Embedded instance, but will fail to retrieve relation properties when using a remoted DB. Indeed, inspecting the database using the webconsole shows the relations have no saved properties.

Obfuscated code follows:

My @NodeEntity has:

@RelatedToVia
private Set<MyRelationalEntity> links = Sets.newHashSet();

And MyRelationalEntity is defined thus:

@RelationshipEntity(type="RELATION_NAME")
public class MyRelationalEntity {
   @GraphId
   @Id
   private Long graphId;
   @Fetch @StartNode
   private TheEntity left;
   @Fetch @EndNode
   private TheEntity right;

   private String scope;
   ...
}

Again, when stored in an embedded instance the scope property is stored and retrieved fine, but via the remoted database there is no data :-(

edit: However, it seems the __type__ property is set correctly on the relation

This might be a known issue, but I don't see any filed issues at https://github.com/spring-projects/spring-data-neo4j. But I'm thinking perhaps GitHub isn't used as the ALM?

Thanks!

Edit 2: After a bit of debugging, I wonded if line 192 in EntityStateHandler might be the culprit? The empty map seems to propagate down to the RestRelationShip class?


回答1:


Ah..

Found this: https://github.com/spring-projects/spring-data-neo4j/blob/master/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/mapping/SourceStateTransmitter.java#L101

Guess that explains things ;-)

Presumably all will be excellent in 3.3.0.RELEASE - until then I'll prefer slow operation over missing functionality :-)

But, still : great work from the spring-data-neo4j team!



来源:https://stackoverflow.com/questions/27861583/3-3-0-m1-properties-on-relationshipentity-not-saved-when-using-cypherrestgraph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!