Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support adding ID attributes of start and end nodes in edge entities #307

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

CorvusYe
Copy link
Collaborator

example:

@Data
@Table(name = "like")
public class Like {

  @Id // 可选,如果两个节点之间同一类型边的唯一性由源节点id和目标节点id共同决定,可以不加当前属性
  private Long rank;
  
  @SrcId // 可选,如果不需要获取关系的源节点id,可以不加当前属性
  private String srcId;
  
  @DstId // 可选,如果不需要获取关系的目标节点id,可以不加当前属性
  private String dstId;

  private Double likeness;
}
     List<Like> selectEdge();
<select id="selectEdge" resultType=“Like”>
    MATCH (n)-[r: like]->(m)
    RETURN r;
</select>
// 伪代码
like.getSrcId() == id(n)  // true
like.getDstId() == id(m) // true

@CorvusYe CorvusYe merged commit 6239e89 into nebula-contrib:master Jul 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant