实际上,我正在尝试使用 RelationshipEntity 类保存一个节点,如下所示:
节点类
@NodeEntity public class MyEvent { @GraphId private Long nodeId; @RelatedToVia(type = "INVITED_TO") @Fetch Set<EventResponse> eventResponse; }
关系实体类
@RelationshipEntity(type="INVITED_TO") public class EventResponse implements Serializable { @GraphId Long nodeId; @StartNode MyEvent event; @EndNode User user; // .....
}
当我试图保存MyEvent
org.neo4j.graphdb.NotFoundException: '__type__' property not found for RelationshipImpl #153 of type 15 between Node[159] and Node[117].
所以我猜基于上述异常,它缺少__type__
识别任何节点类型所需的某个属性。我不完全明白,有什么方法可以保存第一个关系实体,然后是 NodeEntity,反之亦然,或者同时保存?