【发布时间】:2015-11-28 17:48:28
【问题描述】:
我有以下 Neo4j SDN 实体:
@NodeEntity
public class Comment {
private final static String COMMENTED_ON = "COMMENTED_ON";
private final static String CREATED_BY = "CREATED_BY";
@RelatedTo(type = COMMENTED_ON, direction = Direction.OUTGOING)
private Commentable commentable;
private String text;
@RelatedTo(type = CREATED_BY, direction = Direction.OUTGOING)
private User author;
}
以及以下 SDN 存储库方法:
@Override
@Query("MATCH (c:Comment) WHERE id(c) = {commentId} RETURN c")
Comment findOne(@Param("commentId") Long commentId);
由于这个方法调用,我只有Comment 对象和author.id。
如何更改此方法(或 Cypher 查询)以预先填充 author.name?
【问题讨论】:
标签: java neo4j cypher spring-data-neo4j