Neo4j-节点的即时负载动态关系
我问了一个相关的问题。我发现正常关系实体的一切都很顺利,比如:Neo4j-节点的即时负载动态关系,neo4j,spring-data-neo4j,Neo4j,Spring Data Neo4j,我问了一个相关的问题。我发现正常关系实体的一切都很顺利,比如: @RelationshipEntity(type="REL") public class Rel { @GraphId private Long id; @Fetch @StartNode private User start; @Fetch @EndNode private User end; public Rel(){} public Rel(U
@RelationshipEntity(type="REL")
public class Rel {
@GraphId
private Long id;
@Fetch
@StartNode
private User start;
@Fetch
@EndNode
private User end;
public Rel(){}
public Rel(User start, User end) {
this.start = start;
this.end = end;
}
}
但是,如果我添加一个动态关系类型,我就不能急切地加载关系
@RelationshipEntity(type="REL")
public class Rel {
@GraphId
private Long id;
@Fetch
@StartNode
private User start;
@Fetch
@EndNode
private User end;
// define dynamic relationship type
// which cause the issue!!!!
@RelationshipType
private String type;
public Rel(){}
public Rel(User start, User end, String type) {
this.start = start;
this.end = end;
this.type = type;
}
}
问题是什么,如何解决
欢迎提供任何帮助或建议。提前谢谢 Iterable rel=template.getRelationshipsBetween(user,client,UserRelationEntity.class,RelTypes.client.name());
Iterable<UserRelationEntity> rel = template.getRelationshipsBetween(user, client, UserRelationEntity.class, RelTypes.CLIENT.name());