Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4j-节点的即时负载动态关系_Neo4j_Spring Data Neo4j - Fatal编程技术网

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());