【发布时间】:2020-06-10 21:27:17
【问题描述】:
在 arangoDB 中,我们可以创建一条边,在其中我们可以将 @from 和 @to 设置为不同的集合,因为这些都是 json 数据。在 ArangoDB-Spring-Data 库中,我们可以创建一条边,我们必须为 @from 和 @to 提供类型。我想使用相同的边缘添加不同集合之间的关系。例如- 我有一个类 EntitywithKey-
public class EntityWithKey {
@Id
protected String id;
}
我有 2 个扩展 EntityWIthKey 的类
@Document("actors")
@HashIndex(fields = { "name", "surname" }, unique = true)
public class Actor extends EntityWithKey{
private String name;
private String surname;
}
@Document("characters")
@HashIndex(fields = { "name", "surname" }, unique = true)
public class Character extends EntityWithKey {
private String name;
private String surname;
}
我想创建一个像下面这样的边缘-
@Edge
public class ChildOf {
@Id
private String id;
@From
private EntityWithKey child;
@To
private EntityWithKey parent;
}
这样我就可以添加 Actor-Actor、Actor-Character、Character-Character 和 Character-Actor 之间的关系。
但我看到一个错误
nested exception is org.springframework.data.mapping.PropertyReferenceException: No property name found for type EntityWithKey!
这个库有什么选项可以做到这一点吗?
【问题讨论】:
标签: spring-boot arangodb arangodb-java